-
Notifications
You must be signed in to change notification settings - Fork 200
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
[RFC] CI overhaul #622
base: master
Are you sure you want to change the base?
[RFC] CI overhaul #622
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
1 similar comment
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
2f8732a
to
bc28b3b
Compare
@googlebot I signed it! |
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
1 similar comment
CLAs look good, thanks! ℹ️ Googlers: Go here for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like a lot of this pull request, need to take a little bit of a closer look however.
Can you rebase onto master? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the direction this is going makes sense.
|
||
- run: docker pull ${{ matrix.os }} | ||
|
||
- name: Build container image 'basic' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would call this base
and maybe Creating "base" container image for ${{ matrix.os }} (to build Verible inside)
and Adding "bazel" to "base" container image for ${{ matrix.os }}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Images are now renamed to 'basic' and 'build'. I use 'base' for the images that are retrieved from Docker Hub.
.github/workflows/verible-ci.yml
Outdated
run: source ./.github/settings.sh; ./releasing/docker-run.sh basic | ||
|
||
- name: Build container image 'bazel' | ||
run: source ./.github/settings.sh; ./releasing/docker-run.sh bazel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
./releasing/docker-run.sh $OS prepare-image-add-bazel
releasing/centos.dockerfile
Outdated
|
||
RUN yum install -y bison flex | ||
|
||
# Build a newer version of flex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only needed for some versions of CentOS right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. That dockerfile has theree stages:
- The first stage (L1-L12) is used regardless of the OS version.
- The second stage (L14-L25) is executed on CentOS 8 only.
- Others use the third stage right below (L27-L53).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dockerfile was renamed to centos.basic.dockerfile
.
releasing/centos.dockerfile
Outdated
@@ -0,0 +1,52 @@ | |||
ARG _VERSION_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW -- Ideally these commands would be in the README and pull into these files in some way (maybe using tuttest?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, the list of supported base images is located in releasing/supported_bases.txt
. Rather than having that content in the README (which requires parsing Markdown; and that's not fancy), I would just add a link from the README to that file.
This PR is now rebased on top of master. The failure on However, I could not track which is the mistake that is making https://github.com/umarcor/verible/runs/1521978326?check_suite_focus=true#step:6:225
|
Did this pull request fall of the radar ? @mithro you were looking at it last, any fresh comments ? |
6d930d0
to
9ef429b
Compare
Can you rebase this onto master and then I think we can consider merging it? |
28615f4
to
675f086
Compare
dc12df3
to
af29971
Compare
Codecov Report
@@ Coverage Diff @@
## master #622 +/- ##
=======================================
Coverage 92.84% 92.84%
=======================================
Files 337 337
Lines 22500 22500
=======================================
Hits 20891 20891
Misses 1609 1609 Continue to review full report at Codecov.
|
a50953b
to
19fc43b
Compare
Ref #619 #621
This PR shows a different approach to CI and how container images are defined and used.
Currently, all the Dockerfiles are generated in a single shell/bash script, using environment variables for setting versions. That feels unidiomatic. In this PR, Dockerfiles are defined in separate files, which can be edited without the need to escape due to bash constraints. Differences in procedures between versions of the OSs are handled through dockerfile stages. At the same time, version variables are handled through build arguments.
The current Dockerfile generation strategy cats several sections in a single Dockerfile for each target. Instead, this PR defines two images for each target: 'basic' and 'bazel'. The former contains all the dependencies, except Bazel. The latter is based on the former and includes Bazel.
The current build procedure executes a single
docker build
command, where all the dependencies are installed and Verible is built. Then, a dummy container is created just for extracting the artifact. Images and container are not saved/reused. In this PR, twodocker build
commands are executed, one for 'basic' and another one for 'bazel' images. Then, Verible is built in a temporary container.The rationale is that those 'basic' and 'bazel' images do not need to be built each time. Those can be updated in an scheduled workflow. Then, the regular workflow would only need to pull one image and build Verilator in it. At the same time, any contributor can pull the image and build Verilator, without installing all the dependencies each time.
This was not implemented yet, because a registry needs to be used and I want to have feedback first. Nonetheless, the workflow in this PR shows three steps.
Instead of having multiple jobs trying to create a release, in this PR an additional job is defined, which is to be executed after all the build jobs finish. The additional job (named Release) downloads all the artifacts, creates a release and uploads all the assets at once. This job is only executed on branch master, and not for PRs.
/cc @mithro