-
Notifications
You must be signed in to change notification settings - Fork 839
Migrate CircleCI workflows to GitHub Actions (2/3) #3341
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
Conversation
…rkflow Signed-off-by: Azfaar Qureshi <[email protected]> Signed-off-by: Shovnik Bhattacharya <[email protected]> adding table to README and removing vestigial lines from workflow Signed-off-by: Azfaar Qureshi <[email protected]> Added integration and integration-configs-db jobs Signed-off-by: Azfaar Qureshi <[email protected]> reading from cortexproject Signed-off-by: Azfaar Qureshi <[email protected]> Made Step Naming Consistent Signed-off-by: Shovnik Bhattacharya <[email protected]> read tag only if they exist on the push event updating quay image removing old README changing to v2 Addressed changes requested in PR 1/3
| - name: Sym Link Expected Path to Workspace | ||
| run: | | ||
| sudo mkdir -p /go/src/github.com/cortexproject/cortex | ||
| sudo ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex |
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.
Linking the directory instead of the contents of the folder did not work when we tested it.
| echo "Running integration tests with image: $CORTEX_IMAGE" | ||
| go test -tags=requires_docker -timeout 1200s -v -count=1 ./integration/... | ||
| env: | ||
| IMAGE_PREFIX: ${{ secrets.IMAGE_PREFIX }} |
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 secret will need to be added in the forked repo if one wants to change the image_prefix
pracucci
left a comment
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.
Good job on this 2nd part too! 👏 I left few comments and then we should be good to go 🚀
| run: tar -zcvf images.tar.gz /tmp/images | ||
| - name: Upload Images Artifact | ||
| - name: Create Docker Images Archive | ||
| run: tar -cvf images.tar.gz /tmp/images |
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.
Given we're not compressing anymore, could you remove the .gz suffix?
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.
Removed
| needs: build | ||
| runs-on: ubuntu-16.04 | ||
| steps: | ||
| - name: Install Docker Client |
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 also done in build. Is there any way to build a shared step? Just asking, not a blocker.
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.
We could replace this with a YAML anchor (which GitHub Actions has plans to release shortly) or we could write a custom action and use that instead. With the custom action we would replace the Install Docker Client step with something like this in both Build and Integration.
steps:
- name: Install Docker Client
uses: cortexproject/install-docker-client
- run: ...This means you'll have to maintain another actions repo and that might bring unwanted toil when upgrading versions. But it might be worth if you have a lot of boilerplate set-up.
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.
A simple way to have this logic in one place would be to create an install-docker.sh script and call it whenever an image requires a clean docker client installation. This would also make it easier to update the docker version in a single place. Is that close to what you had in mind?
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 a better idea imo. This way you won't need to update the docker client version manually every time the install docker client step is called. The script can simply read $VER which can be set as a global variable for the entire workflow at the top of the file.
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 committed the solution using an install-docker script. Let me know if it is okay. @pracucci
| uses: actions/download-artifact@v2 | ||
| with: | ||
| name: Docker Images | ||
| - name: Create Docker Images Archive |
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 guess you mean "Extract" instead of "Create"
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.
Slight brain fart 😅 , thanks
| docker pull quay.io/cortexproject/cortex:v0.6.0 | ||
| docker pull quay.io/cortexproject/cortex:v0.7.0 |
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.
Could you remove this, please? Not required anymore.
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.
Removed
| export CORTEX_IMAGE="${CORTEX_IMAGE_PREFIX}cortex:${TAG:-$(./tools/image-tag)}" | ||
| export CORTEX_CHECKOUT_DIR="/go/src/github.com/cortexproject/cortex" | ||
| echo "Running integration tests with image: $CORTEX_IMAGE" | ||
| go test -tags=requires_docker -timeout 1200s -v -count=1 ./integration/... |
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 recently increased this timeout to 1800s. Could you update it, please?
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.
Updated
| run: | | ||
| touch build-image/.uptodate | ||
| MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations | ||
| make BUILD_IMAGE=quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP TTY='' configs-integration-test |
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.
Could you add a comment to explain why we need TTY='', please?
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 default runners in GitHub Actions don't support TTY :( actions/runner#241 and a GitHub member responded saying its fairly low prio in their backlog.
This is what happens when we remove TTY='':
However, there is a workaround we can do if you'd like it back: https://man7.org/linux/man-pages/man1/script.1.html
(script -e -c $COMMAND_HERE)
The snippet would be changed to:
steps:
- uses: actions/checkout@v1
run: |
touch build-image/.uptodate
MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations
script -e -c "make BUILD_IMAGE=quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP configs-integration-test"This works and enables the command to run with TTY but this seemed kind of hacky to me so I left it as TTY=''
Would you like us to change the line to use script -e -c or just add a comment saying GHA doesnt support TTY in their default runners yet
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 comment explaining why TTY='' is fine.
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.
just add a comment saying GHA doesnt support TTY in their default runners yet
Let's just add a comment, but not a block so you can do it in a following PR.
Signed-off-by: Shovnik Bhattacharya <[email protected]>
226f5d4 to
fce62df
Compare
Signed-off-by: Shovnik Bhattacharya <[email protected]>
fce62df to
5934d49
Compare
|
Hey @pracucci , we addressed all the changes requested in the comments on the PR. Is this PR in a state ready to be merged? |
pstibrany
left a comment
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.
Thanks for your work!
pracucci
left a comment
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.
LGTM, thanks!
| run: | | ||
| touch build-image/.uptodate | ||
| MIGRATIONS_DIR=$(pwd)/cmd/cortex/migrations | ||
| make BUILD_IMAGE=quay.io/cortexproject/build-image:upgrade-build-image-debian-491e60715-WIP TTY='' configs-integration-test |
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.
just add a comment saying GHA doesnt support TTY in their default runners yet
Let's just add a comment, but not a block so you can do it in a following PR.
…rgid-ctx * 'master' of github.com:cortexproject/cortex: Enforce integration tests default flags config to never be overwritten (cortexproject#3370) Avoid deletion of blocks which are not shipped (cortexproject#3346) Upgrade Thanos to latest master (cortexproject#3363) Migrate CircleCI workflows to GitHub Actions (2/3) (cortexproject#3341) Remove comments that doesn't seem right (cortexproject#3361) add ingester interface (cortexproject#3352) Fail fast an ingester if unable to load existing TSDBs (cortexproject#3354) Fixed Gossip memberlist members joining when addresses are configured using DNS-based service discovery (cortexproject#3360) Export distributor method to get ingester replication set (cortexproject#3356) Correct link for Block Storage reference (cortexproject#3234) Added section on Cleaner. (cortexproject#3327) Update prometheus vendor to master (cortexproject#3345) adding GHA CI env variable check (cortexproject#3351) Add ingesters shuffle sharding support on the read path (cortexproject#3252)

What this PR does
This is PR 2/3 of migrating Cortex's CI from CircleCI to GitHub Actions:
Part 1/3
test-build-deployworkflow under.github/workflowslinttestbuildmasteror when any PR is opened. However CD jobs will only run on the master branch and will be skipped otherwisePart 2/3 👈
buildintegrationintegration-config-dbPart 3/3
deploy_websiteis dependant onbuild, testdeployis dependant onbuild, test, lint, integration, integration-config-dbcc - @alolita
Which issue(s) this PR fixes:
fixes a part of #3274
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]