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

ci: automate quic-network-simulator docker image build & push #1554

Merged
merged 17 commits into from
Jan 16, 2024

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Jan 15, 2024

Changes

  • Publish ghcr.io/mozilla/neqo-qns docker image on a daily schedule and test build on related pull requests.
  • Remove qns/update.sh. Is this still needed?
  • Remove /neqo-reference indirection in qns/Dockerfile.

Follow-ups

Fixes #1552


on:
push:
branches: ["main", "docker"] # TODO: remove docker
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
branches: ["main", "docker"] # TODO: remove docker
branches: ["main"]

To be removed before merge.

qns/Dockerfile Outdated
@@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.45.2
RUST_VERSION=1.70.0
Copy link
Collaborator Author

@mxinden mxinden Jan 15, 2024

Choose a reason for hiding this comment

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

Same as version in check.yml:

rust-toolchain: [1.70.0, stable, beta]

@codecov-commenter
Copy link

codecov-commenter commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6fb7a6c) 86.52% compared to head (0578504) 86.52%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1554   +/-   ##
=======================================
  Coverage   86.52%   86.52%           
=======================================
  Files         117      117           
  Lines       38170    38170           
=======================================
  Hits        33025    33025           
  Misses       5145     5145           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@larseggert larseggert left a comment

Choose a reason for hiding this comment

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

Do you think this could be made a "reusable workflow" contingent on the ubuntu-latest/1.70.0 run of the main CI succeeding?

@mxinden mxinden marked this pull request as draft January 15, 2024 14:08
@mxinden
Copy link
Collaborator Author

mxinden commented Jan 15, 2024

Thank you for the quick review!

Do you think this could be made a "reusable workflow" contingent on the ubuntu-latest/1.70.0 run of the main CI succeeding?

@larseggert can you expand on why a reusable workflow would be helpful here? Where would we be reusing this logic?

For the sake of not pushing a faulty image, I have now made the qns-docker-image job dependent on the check job.

Note that it does not depend on the matrix variant ubuntu-latest/1.70.0 in particular, but on the success of the entire matrix. In case we want to optimize the job's runtime, I suggest looking into further caching mechanisms first. The last execution of the new job took 3m 35s.

@mxinden mxinden marked this pull request as ready for review January 15, 2024 14:57
Copy link
Collaborator Author

@mxinden mxinden Jan 15, 2024

Choose a reason for hiding this comment

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

Given that this workflow goes beyond checking now, I suggest renaming the file to e.g. main.yml. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

I would put your additions in a new file instead. Call it qns.yml

The conditions for this should be different. We want pushes to occur at most daily on main.

We should not build this for pull requests on the expectation that if tests pass, this build will work, so we don't need to run this process unless someone changes the qns.yml file or the Dockerfile (conditions you might add for a pull_request in that file).

Copy link
Collaborator Author

@mxinden mxinden Jan 16, 2024

Choose a reason for hiding this comment

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

I moved the job into a separate file and adjusted the triggers. It will now run on a daily schedule. In addition, pull requests touching related files will build the image but not push it. Let me know if that is good enough.

be2d481 598e12a

Copy link
Member

Choose a reason for hiding this comment

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

I would put your additions in a new file instead. Call it qns.yml

The conditions for this should be different. We want pushes to occur at most daily on main.

We should not build this for pull requests on the expectation that if tests pass, this build will work, so we don't need to run this process unless someone changes the qns.yml file or the Dockerfile (conditions you might add for a pull_request in that file).

Comment on lines 138 to 142
- name: Extract Rust version
id: rust-version
run: |
RUST_VERSION=$(grep -m1 'rust-version' neqo-common/Cargo.toml | cut -d '"' -f 2)
echo "::set-output name=version::$RUST_VERSION"
Copy link
Member

Choose a reason for hiding this comment

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

That's going to run this with our MSRV, rather than the latest. I would just run on stable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

a98aa1e updates the workflow to use stable.

qns/Dockerfile Outdated
cp target/release/neqo-client target; \
cp target/release/neqo-server target; \
rm -rf target/release
--bin neqo-client --bin neqo-server;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
--bin neqo-client --bin neqo-server;
--bin neqo-client --bin neqo-server

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 thanks for the catch! ae21e35

Comment on lines 135 to 137
- name: Checkout
uses: actions/checkout@v3

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- name: Checkout
uses: actions/checkout@v3

https://github.com/docker/build-push-action#git-context

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool. This was news to me.

e2af258

qns/Dockerfile Outdated
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.45.2
PATH=/usr/local/cargo/bin:$PATH

RUN set -eux; \
curl -sSLf "https://static.rust-lang.org/rustup/archive/1.22.1/x86_64-unknown-linux-gnu/rustup-init" -o rustup-init; \
Copy link
Member

Choose a reason for hiding this comment

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

It might be a good idea to update the version of rustup-init we use.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍 5d10ede

@@ -10,10 +10,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get autoremove -y && apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

ARG RUST_VERSION
Copy link
Member

Choose a reason for hiding this comment

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

I think that we can keep this change, but I would prefer if our builds use 'stable'.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mxinden
Copy link
Collaborator Author

mxinden commented Jan 16, 2024

Thanks @martinthomson. Mind taking another look?

Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

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

Let's give this a spin. We'll need to update the interop runner repo with the outcome.

.github/workflows/qns.yml Outdated Show resolved Hide resolved
@martinthomson martinthomson merged commit ba59d54 into mozilla:main Jan 16, 2024
10 checks passed
@mxinden
Copy link
Collaborator Author

mxinden commented Jan 17, 2024

We'll need to update the interop runner repo with the outcome.

👍 see quic-interop/quic-interop-runner#344.

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.

consider building and pushing Interop Runner Docker image in CI
4 participants