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

initial project setup #16

Merged
merged 1 commit into from
Jan 22, 2021
Merged

initial project setup #16

merged 1 commit into from
Jan 22, 2021

Conversation

webern
Copy link
Contributor

@webern webern commented Jan 20, 2021

Issue number:

Beginning of work on #1.

Description of changes:

We decided that #15 was too much of a code dump. We will instead provide several PRs that get us to that state, such that the diff of each PR is a smaller diff. This is the first such PR.

In this commit we set up the basic project structure.
- An integ crate that will serve as our driver for integration testing.
  Eventually this will be used to set up and run Bottlerocket instances
  that the updater can be tested against.
- The updater crate. This will become the binary that checks and updates
  Bottlerocket instances.
- A simple Dockerfile and Makefile, since we will be deploying the
  updater to Fargate.

updater has a lib.rs file so that we can re-use some code from updater
in integ, and so that updater can have a useful tests directory.

Testing done:

cargo test works in both the integ and updater directories.
make image works at the root of the project.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Makefile Outdated Show resolved Hide resolved
COPY . /volume
RUN cargo build --locked --release --target x86_64-unknown-linux-musl

FROM alpine
Copy link
Contributor

Choose a reason for hiding this comment

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

Why Alpine? Why not scratch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need a Linux to run the binary. There are no requirements of the Linux, I was looking for something small. What is the best choice?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a Linux userland? It looks like we're building a statically-linked binary, which can run in a scratch container. In the Kubernetes update operator this is what we do.

If we do need a Linux userland for some reason, the other container images we vend use Amazon Linux.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I didn't realize scratch could run binaries. I'll change it to that, seems like it should work.

Copy link
Contributor Author

@webern webern Jan 20, 2021

Choose a reason for hiding this comment

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

Why Alpine? Why not scratch?

Fixed in a01376f

updater/Dockerfile Outdated Show resolved Hide resolved
updater/src/args.rs Outdated Show resolved Hide resolved
integ/src/integ_args.rs Outdated Show resolved Hide resolved
@webern webern requested review from etungsten, samuelkarp and jahkeup and removed request for etungsten January 20, 2021 18:53
Copy link
Contributor

@srgothi92 srgothi92 left a comment

Choose a reason for hiding this comment

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

🏆

updater/src/args.rs Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
integ/Cargo.toml Outdated Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented Jan 20, 2021

webern force-pushed the setup branch from fcdb1a3 to a01376f 27 seconds ago

Use the Bottlerocket SDK and scratch for running the binary.

@webern
Copy link
Contributor Author

webern commented Jan 20, 2021

webern force-pushed the setup branch from a01376f to 4f485ce now

Align arguments to cluster_name.

@webern
Copy link
Contributor Author

webern commented Jan 20, 2021

webern force-pushed the setup branch from 4f485ce to e06311c now

Bump rusoto and tokio.

@webern webern requested a review from arnaldo2792 January 20, 2021 23:02
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented Jan 21, 2021

webern force-pushed the setup branch from a8ad70d to 51fca71 now

Typo fixes.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
updater/Dockerfile Outdated Show resolved Hide resolved
updater/Dockerfile Outdated Show resolved Hide resolved
updater/Dockerfile Outdated Show resolved Hide resolved
updater/Dockerfile Outdated Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented Jan 21, 2021

webern force-pushed the setup branch from 51fca71 to 76e354e now

Some of @jahkeup suggestions in the Dockerfile.

@webern
Copy link
Contributor Author

webern commented Jan 22, 2021

webern force-pushed the setup branch from 76e354e to 2455e3f 37 seconds ago

The rest of @jahkeup 's suggestions.

Makefile Outdated Show resolved Hide resolved
scripts/load-bottlerocket-sdk.sh Outdated Show resolved Hide resolved
updater/Dockerfile Outdated Show resolved Hide resolved
Makefile Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented Jan 22, 2021

webern force-pushed the setup branch from 2455e3f to c63e358 (above)
webern force-pushed the setup branch from c63e358 to ed61209 (below)

Fixes for @jahkeup 's latest batch.

In this commit we set up the basic project structure.
- An integ crate that will serve as our driver for integration testing.
  Eventually this will be used to set up and run Bottlerocket instances
  that the updater can be tested against.
- The updater crate. This will become the binary that checks and updates
  Bottlerocket instances.
- A simple Dockerfile and Makefile, since we will be deploying the
  updater to Fargate.

updater has a lib.rs file so that we can re-use some code from updater
in integ, and so that updater can have a useful tests directory.
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.

4 participants