Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed jailer build process #2125

Merged
merged 2 commits into from
Sep 15, 2020

Conversation

krishnakumar4a4
Copy link
Contributor

@krishnakumar4a4 krishnakumar4a4 commented Sep 8, 2020

This fix is to make tools/devtool to build jailer binary
only for musl targets.

Currently, jailer binary gets built successfully for even
non-musl targets but doesn't work with corresponding
firecracker binary.

Reason for This PR

As mentioned in #2102

Currently, jailer binary gets built successfully for even
non-musl targets but doesn't work with corresponding
firecracker binary. This commit ensures jailer is not built for non-musl
targets.

Description of Changes

  • Modifed Cargo.toml workspace to exclude jailer for default build

  • Modified devtool script to build jailer binary only for musl targets

  • Updated changelog with the fix information

  • This functionality can be added in rust-vmm.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any newly added unsafe code is properly documented.
  • Any API changes are reflected in firecracker/swagger.yaml.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

@alindima alindima self-assigned this Sep 9, 2020
@alindima alindima self-requested a review September 9, 2020 09:04
@alindima alindima removed their assignment Sep 9, 2020
Copy link
Contributor

@alindima alindima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR.
In addition to modifying devtool, it seems that we need to also modify the get_firecracker_binaries() method (in tests/host_tools/cargo_build.py) that is used for building the binaries for CI tests. This is the reason the tests are failing, because they are unable to find the jailer binary.

I have tried adding the additional jailer build command, but some tests time out building the binaries. The two commands, instead of one, take too long, so we need a mechanism for building the binaries inside get_firecracker_binaries only once per CI test run. Using something like a function attribute maybe?

Cargo.toml Outdated Show resolved Hide resolved
CHANGELOG.md Outdated
@@ -82,6 +82,8 @@
accepting negative values.
- Fixed #1754 - net: traffic blocks when running ingress UDP performance tests
with very large buffers.
- Fixed `devtool build` to build jailer binary for `musl` only targets. Building
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in the UNRELEASED section of the changelog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if this will be moved from "UNRELEASED" to "Fixed" section before release? Anyways I have made the change. Working on the test now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be moved from Unreleased in the future. The v0.22.0 release already exists so these new changes will be included in a future release.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we actually fixing something through the PR? Or should this line be expressed as updated or something else?

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @gc-plp and @alindima , modified this line to "changed" instead of "fixed" and moved it to Changed sub-section of UnReleased.

@krishnakumar4a4 krishnakumar4a4 force-pushed the fix-jailer-build branch 5 times, most recently from b7531f7 to 8898af9 Compare September 12, 2020 08:30
@krishnakumar4a4 krishnakumar4a4 marked this pull request as ready for review September 12, 2020 08:57
@krishnakumar4a4
Copy link
Contributor Author

Hi @alindima , I have made requested changes and fixed tests as well. Please let me know if anything else needs to be done here?

Copy link
Contributor

@alindima alindima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. I added some minor comments that need to be addressed first.

CHANGELOG.md Outdated Show resolved Hide resolved
tests/host_tools/cargo_build.py Outdated Show resolved Hide resolved
@krishnakumar4a4 krishnakumar4a4 force-pushed the fix-jailer-build branch 2 times, most recently from 21e7534 to 2b7cc5e Compare September 14, 2020 18:32
This change is to make tools/devtool to build jailer binary
only for musl targets.

Currently, jailer binary gets built successfully for even
non-musl targets but doesn't work with corresponding
firecracker binary.

Also modified integration build tests to build firecracker
and jailer binaries only once to be used repeatitively
@krishnakumar4a4
Copy link
Contributor Author

The changes look good to me. I added some minor comments that need to be addressed first.

I have made necessary changes. Please have a look

Copy link
Contributor

@alindima alindima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alindima alindima merged commit 3bf285c into firecracker-microvm:master Sep 15, 2020
@alindima
Copy link
Contributor

@krishnakumar4a4 Thank you for the contribution!

@krishnakumar4a4
Copy link
Contributor Author

@alindima and @gc-plp, I really appreciate your support and feedback.

kzys added a commit to kzys/firecracker-go-sdk that referenced this pull request Sep 21, 2020
Since firecracker-microvm/firecracker#2125,
`cargo build` doesn't build jailer by default.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
kzys added a commit to kzys/firecracker-go-sdk that referenced this pull request Sep 21, 2020
Since firecracker-microvm/firecracker#2125,
`cargo build` doesn't build jailer by default.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
xibz pushed a commit to xibz/firecracker-go-sdk that referenced this pull request Oct 9, 2020
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263)
* Fix Benchmark Goroutine (firecracker-microvm#259)
* Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255)
* Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253)
* Fixed error that was not being test against in `TestWait` (firecracker-microvm#251)
* Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230)
* Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225)
* Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218)

Signed-off-by: Debian <admin@ip-172-31-27-214.us-east-2.compute.internal>
xibz pushed a commit to xibz/firecracker-go-sdk that referenced this pull request Oct 20, 2020
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263)
* Fix Benchmark Goroutine (firecracker-microvm#259)
* Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255)
* Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253)
* Fixed error that was not being test against in `TestWait` (firecracker-microvm#251)
* Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230)
* Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225)
* Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218)

Signed-off-by: Debian <admin@ip-172-31-27-214.us-east-2.compute.internal>
xibz pushed a commit to xibz/firecracker-go-sdk that referenced this pull request Oct 23, 2020
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263)
* Fix Benchmark Goroutine (firecracker-microvm#259)
* Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255)
* Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253)
* Fixed error that was not being test against in `TestWait` (firecracker-microvm#251)
* Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230)
* Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225)
* Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218)

Signed-off-by: Debian <admin@ip-172-31-27-214.us-east-2.compute.internal>
xibz pushed a commit to xibz/firecracker-go-sdk that referenced this pull request Oct 23, 2020
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263)
* Fix Benchmark Goroutine (firecracker-microvm#259)
* Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255)
* Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253)
* Fixed error that was not being test against in `TestWait` (firecracker-microvm#251)
* Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230)
* Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225)
* Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218)

Signed-off-by: Debian <admin@ip-172-31-27-214.us-east-2.compute.internal>
Signed-off-by: xibz <impactbchang@gmail.com>
xibz pushed a commit to xibz/firecracker-go-sdk that referenced this pull request Oct 23, 2020
* Since firecracker-microvm/firecracker#2125, `cargo build` doesn't build jailer by default. (firecracker-microvm#263)
* Fix Benchmark Goroutine (firecracker-microvm#259)
* Jailer configuration API cleanup and improved logging with Debug log level (firecracker-microvm#255)
* Firecracker is internally has an instance ID, but the SDK didn't have the way to configure the ID. This change connects Config.VMID to the instance ID. (firecracker-microvm#253)
* Fixed error that was not being test against in `TestWait` (firecracker-microvm#251)
* Fixes issue where socket path may not be defined since the config file has yet to be loaded (firecracker-microvm#230)
* Fixed error that was not being test against in `TestNewPlugin` (firecracker-microvm#225)
* Download Firecracker 0.21.1 and its jailer from Makefile (firecracker-microvm#218)

Signed-off-by: xibz <impactbchang@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants