-
Notifications
You must be signed in to change notification settings - Fork 12
[5/6 Deps Update] Update all workflows and actions to use UV #400
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
Changes from all commits
465ba3c
c16b972
016001e
f5947ca
9b51d6e
1eb2f3b
1f83376
a92da09
801498a
13cbbfc
1633a80
24a755f
23a251d
578dc2d
8b8d586
3a2f719
f2fb1e1
12ff5e3
dd2356a
2af743f
2b5accb
ea58f5b
fbe84b1
116b899
2a95e16
8d1eb64
b361d70
726e187
d4f0a0e
51af343
15f1eb9
84fe7f6
2aed425
e406f1e
0e77ed5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #!/bin/bash | ||
| # Script to update dep_vars.env and cloud builder config with new Docker image references | ||
|
|
||
| set -e | ||
|
|
||
| echo "Writing new image names to dep_vars.env:" | ||
| echo " DOCKER_LATEST_BASE_CUDA_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CUDA_IMAGE}" | ||
| echo " DOCKER_LATEST_BASE_CPU_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CPU_IMAGE}" | ||
| echo " DOCKER_LATEST_BASE_DATAFLOW_IMAGE_NAME_WITH_TAG=${GIGL_BASE_DATAFLOW_IMAGE}" | ||
| echo " DOCKER_LATEST_BUILDER_IMAGE_NAME_WITH_TAG=${GIGL_BUILDER_IMAGE}" | ||
|
|
||
| sed -i "s|^DOCKER_LATEST_BASE_CUDA_IMAGE_NAME_WITH_TAG=.*|DOCKER_LATEST_BASE_CUDA_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CUDA_IMAGE}|" dep_vars.env | ||
| sed -i "s|^DOCKER_LATEST_BASE_CPU_IMAGE_NAME_WITH_TAG=.*|DOCKER_LATEST_BASE_CPU_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CPU_IMAGE}|" dep_vars.env | ||
| sed -i "s|^DOCKER_LATEST_BASE_DATAFLOW_IMAGE_NAME_WITH_TAG=.*|DOCKER_LATEST_BASE_DATAFLOW_IMAGE_NAME_WITH_TAG=${GIGL_BASE_DATAFLOW_IMAGE}|" dep_vars.env | ||
| sed -i "s|name: us-central1-docker\.pkg\.dev.*|name: ${GIGL_BUILDER_IMAGE}|" .github/cloud_builder/run_command_on_active_checkout.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ on: | |
| pr_number: | ||
| description: 'PR to run the workflow on' | ||
| required: true | ||
|
|
||
| env: | ||
| DOCKER_BUILDKIT: 1 | ||
| GIGL_BASE_CUDA_IMAGE: us-central1-docker.pkg.dev/${{ vars.GCP_PROJECT_ID }}/public-gigl/gigl-cuda-base:${{ github.sha }}.${{ github.run_number }}.${{ github.run_attempt }} | ||
|
|
@@ -16,6 +17,7 @@ env: | |
|
|
||
| jobs: | ||
| comment-workflow-started: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Comment on PR | ||
|
|
@@ -29,7 +31,7 @@ jobs: | |
| Once done, the workflow will update the `dep_vars.env` file with the new image names. | ||
|
|
||
| build-cuda-base-image: | ||
| runs-on: gigl-large-instances # x64 Ubuntu:latest w/ 4 cores, 16GB RAM, 150 GB SSD | ||
| runs-on: gigl-large-instances # x64 Ubuntu:latest w/ 8-cores, 32GB RAM, 300 GB SSD | ||
| permissions: | ||
| # Needed for gcloud auth: https://github.com/google-github-actions/auth | ||
| contents: 'read' | ||
|
|
@@ -41,7 +43,7 @@ jobs: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| pr_number: ${{ inputs.pr_number }} | ||
| - name: Setup Machine for building Docker images | ||
| uses: snapchat/gigl/.github/actions/setup-python-tools@main | ||
| uses: ./.github/actions/setup-python-tools | ||
| with: | ||
| setup_gcloud: "true" | ||
| try_cleaning_disk_space: "true" | ||
|
|
@@ -56,8 +58,8 @@ jobs: | |
| docker push ${GIGL_BASE_CUDA_IMAGE} | ||
| echo "Pushed CUDA base image to ${GIGL_BASE_CUDA_IMAGE}" | ||
|
|
||
| build-cpu-base-images: | ||
| runs-on: gigl-large-instances # x64 Ubuntu:latest w/ 4 cores, 16GB RAM, 150 GB SSD | ||
| build-cpu-base-image: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # Needed for gcloud auth: https://github.com/google-github-actions/auth | ||
| contents: 'read' | ||
|
|
@@ -69,14 +71,13 @@ jobs: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| pr_number: ${{ inputs.pr_number }} | ||
| - name: Setup Machine for building Docker images | ||
| uses: snapchat/gigl/.github/actions/setup-python-tools@main | ||
| uses: ./.github/actions/setup-python-tools | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We are planning on reverting this right?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wont merge if I revert since it needs updated workflows to run and those workflows wont be in main when this is running CI. Maybe post merging everything I can raise a PR. |
||
| with: | ||
| setup_gcloud: "true" | ||
| try_cleaning_disk_space: "true" | ||
| gcp_project_id: ${{ vars.GCP_PROJECT_ID }} | ||
| workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | ||
| gcp_service_account_email: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} | ||
|
|
||
| - name: Build and Push CPU Base Image and Docker CPU Image | ||
| run: | | ||
| gcloud auth configure-docker us-central1-docker.pkg.dev | ||
|
|
@@ -85,8 +86,30 @@ jobs: | |
| docker push ${GIGL_BASE_CPU_IMAGE} | ||
| echo "Pushed CPU base image to ${GIGL_BASE_CPU_IMAGE}" | ||
|
|
||
| echo "Will use CPU image ${GIGL_BASE_CPU_IMAGE} as base image for Dataflow image." | ||
| docker build -f ./containers/Dockerfile.dataflow.base --build-arg BASE_IMAGE=${GIGL_BASE_CPU_IMAGE} -t ${GIGL_BASE_DATAFLOW_IMAGE} . | ||
| build-dataflow-base-image: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| # Needed for gcloud auth: https://github.com/google-github-actions/auth | ||
| contents: 'read' | ||
| id-token: 'write' | ||
| steps: | ||
| - name: Checkout PR Branch | ||
| uses: snapchat/gigl/.github/actions/checkout-pr-branch@main | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| pr_number: ${{ inputs.pr_number }} | ||
| - name: Setup Machine for building Docker images | ||
| uses: ./.github/actions/setup-python-tools | ||
svij-sc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| setup_gcloud: "true" | ||
| try_cleaning_disk_space: "true" | ||
| gcp_project_id: ${{ vars.GCP_PROJECT_ID }} | ||
| workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} | ||
| gcp_service_account_email: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} | ||
| - name: Build and Push Dataflow Base Image | ||
| run: | | ||
| gcloud auth configure-docker us-central1-docker.pkg.dev | ||
| docker build -f ./containers/Dockerfile.dataflow.base -t ${GIGL_BASE_DATAFLOW_IMAGE} . | ||
| docker push ${GIGL_BASE_DATAFLOW_IMAGE} | ||
| echo "Pushed Dataflow base image to ${GIGL_BASE_DATAFLOW_IMAGE}" | ||
|
|
||
|
|
@@ -103,7 +126,7 @@ jobs: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| pr_number: ${{ inputs.pr_number }} | ||
| - name: Setup Machine for building Docker images | ||
| uses: snapchat/gigl/.github/actions/setup-python-tools@main | ||
| uses: ./.github/actions/setup-python-tools | ||
svij-sc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| setup_gcloud: "true" | ||
| try_cleaning_disk_space: "true" | ||
|
|
@@ -124,7 +147,8 @@ jobs: | |
| build-and-commit-base-images: | ||
| needs: | ||
| - build-cuda-base-image | ||
| - build-cpu-base-images | ||
| - build-cpu-base-image | ||
| - build-dataflow-base-image | ||
| - build-builder-image | ||
|
Comment on lines
+150
to
152
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason we need this change now?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping :)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Since we have updated building the docker image - it made sense to update this too. |
||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
@@ -134,23 +158,12 @@ jobs: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| pr_number: ${{ inputs.pr_number }} | ||
| should_leave_progress_comments: "false" | ||
| command: | | ||
| echo "Writing new image names to dep_vars.env:" | ||
| echo " DOCKER_LATEST_BASE_CUDA_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CUDA_IMAGE}" | ||
| echo " DOCKER_LATEST_BASE_CPU_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CPU_IMAGE}" | ||
| echo " DOCKER_LATEST_BASE_DATAFLOW_IMAGE_NAME_WITH_TAG=${GIGL_BASE_DATAFLOW_IMAGE}" | ||
| echo " DOCKER_LATEST_BUILDER_IMAGE_NAME_WITH_TAG=${GIGL_BUILDER_IMAGE}" | ||
| sed -i "s|^DOCKER_LATEST_BASE_CUDA_IMAGE_NAME_WITH_TAG=.*|DOCKER_LATEST_BASE_CUDA_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CUDA_IMAGE}|" dep_vars.env | ||
| sed -i "s|^DOCKER_LATEST_BASE_CPU_IMAGE_NAME_WITH_TAG=.*|DOCKER_LATEST_BASE_CPU_IMAGE_NAME_WITH_TAG=${GIGL_BASE_CPU_IMAGE}|" dep_vars.env | ||
| sed -i "s|^DOCKER_LATEST_BASE_DATAFLOW_IMAGE_NAME_WITH_TAG=.*|DOCKER_LATEST_BASE_DATAFLOW_IMAGE_NAME_WITH_TAG=${GIGL_BASE_DATAFLOW_IMAGE}|" dep_vars.env | ||
| sed -i "s|name: us-central1-docker\.pkg\.dev.*|name: ${GIGL_BUILDER_IMAGE}|" .github/cloud_builder/run_command_on_active_checkout.yaml | ||
|
|
||
| command: bash .github/scripts/update_docker_image_refs.sh | ||
| - name: Commit and Push Dep Vars | ||
| uses: snapchat/gigl/.github/actions/commit-and-push@main | ||
| with: | ||
| commit_message: "[AUTOMATED] Update dep.vars, and other relevant files with new image names" | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - uses: snapchat/gigl/.github/actions/comment-on-pr@main | ||
| with: | ||
| pr_number: ${{ inputs.pr_number }} | ||
|
|
||
svij-sc marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.