-
Notifications
You must be signed in to change notification settings - Fork 687
build(actions): AS-771 build internal images for vuln scannings #6144
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7ca480d
build(actions): AS-771 build internal images for vuln scannings
afoley587 14bb14e
build(actions): AS-771 comments about timing
afoley587 4968b04
build(actions): Contents-read
afoley587 892062f
build(actions): spacing
afoley587 67318c7
build(actions): CR suggestions
afoley587 56a8987
build(actions): CR suggestions
afoley587 1313df8
chore(CODEOWNERS): Add aloha to .github
afoley587 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Build Internal Docker Images | ||
| on: | ||
| workflow_dispatch: {} | ||
| schedule: | ||
| # 4:05AM On Thursdays for vuln assessments. | ||
| - cron: '5 4 * * 4' | ||
| jobs: | ||
| build-image: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: 'write' | ||
| id-token: 'write' | ||
| strategy: | ||
| matrix: | ||
| python: | ||
| # A matrix in the event we want to add more | ||
| # python versions to this list. | ||
| - "3.11" | ||
| env: | ||
| GCP_DOCKER_REPOSITORY: dev-docker | ||
| GCP_LOCATION: us-central1 | ||
| steps: | ||
| - name: Clone fiftyone | ||
| uses: actions/checkout@v4 | ||
| - name: Authenticate to Google Cloud | ||
| uses: google-github-actions/auth@v2 | ||
| with: | ||
| project_id: ${{ secrets.REPO_GCP_PROJECT }} | ||
| service_account: ${{ secrets.REPO_GCP_SERVICE_ACCOUNT }} | ||
| workload_identity_provider: ${{ secrets.REPO_GOOGLE_WORKLOAD_IDP }} | ||
| - name: Set Up Cloud SDK | ||
| uses: google-github-actions/setup-gcloud@v2 | ||
| - name: Docker login | ||
| run: | | ||
| gcloud auth configure-docker "${{ env.GCP_LOCATION }}-docker.pkg.dev" --quiet | ||
| - name: Set Env Vars | ||
| run: | | ||
| fo_version=$(grep -E 'VERSION.*=.*\".*\"$' ./setup.py | awk '{ print $3 }' | tr -d '"') | ||
| short_sha="$(git rev-parse --short HEAD)" | ||
| echo "fo_version=$fo_version" >> "$GITHUB_ENV" | ||
| echo "pyver=${{ matrix.python }}" >> "$GITHUB_ENV" | ||
| echo "short_sha=$short_sha" >> "$GITHUB_ENV" | ||
| echo "today=$(date +%Y%m%d)" >> "$GITHUB_ENV" | ||
afoley587 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Set up Docker Buildx | ||
afoley587 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Build and push internal image | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| build-args: | | ||
| BUILD_TYPE=released | ||
| FO_VERSION=${{ env.fo_version }} | ||
| PYTHON_VERSION=${{ env.pyver }} | ||
| context: . | ||
| # Not doing multi-platform builds as the intent of this | ||
| # is for security scanning. | ||
| # Multi-platform builds take an additional 10 minutes to build | ||
| # and this seems like it would give us the same level of scanning | ||
| # functionality. | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| push: true | ||
| sbom: true | ||
| tags: | | ||
| ${{ env.GCP_LOCATION }}-docker.pkg.dev/${{ secrets.REPO_GCP_PROJECT }}/${{ env.GCP_DOCKER_REPOSITORY }}/fiftyone:${{ env.fo_version }}-${{ env.short_sha }}-python${{ env.pyver }}-${{ env.today }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.