Skip to content

Commit

Permalink
Merge branch 'master' into docs-cross-account-sns
Browse files Browse the repository at this point in the history
  • Loading branch information
sir-sigurd authored Dec 11, 2024
2 parents f641d2f + cda3d76 commit ce36358
Show file tree
Hide file tree
Showing 855 changed files with 44,639 additions and 19,093 deletions.
5 changes: 0 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ updates:
schedule:
interval: "daily"

- package-ecosystem: "docker"
directory: "/lambdas/molecule"
schedule:
interval: "daily"

- package-ecosystem: "docker"
directory: "/catalog"
schedule:
Expand Down
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [ ] Automated tests (e.g. Preflight)
- [ ] Confirm that this change meets security best practices and does not violate the security model
- [ ] Documentation
- [ ] run `optipng` on any new PNGs
- [ ] [Python: Run `build.py`](../tree/master/gendocs/build.py) for new docstrings
- [ ] JavaScript: basic explanation and screenshot of new features
- [ ] Markdown somewhere in docs/**/*.md that explains the feature to end users (said .md files should be linked from SUMMARY.md so they appear on https://docs.quiltdata.com)
Expand Down
68 changes: 68 additions & 0 deletions .github/workflows/deploy-catalog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Deploy catalog to ECR

on:
push:
branches:
- master
paths:
- '.github/workflows/deploy-catalog.yaml'
- 'catalog/**'
- 'shared/**'

jobs:
deploy-catalog-ecr:
runs-on: ubuntu-latest
defaults:
run:
working-directory: catalog
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: 'catalog/package.json'
cache: 'npm'
cache-dependency-path: 'catalog/package-lock.json'
- run: npm ci
- run: npm run build
- name: Configure AWS credentials from Prod account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::730278974607:role/github/GitHub-Quilt
aws-region: us-east-1
- name: Login to Prod ECR
id: login-prod-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Login to MP ECR
id: login-mp-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registries: 709825985650
- name: Configure AWS credentials from GovCloud account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws-us-gov:iam::313325871032:role/github/GitHub-Quilt
aws-region: us-gov-east-1
- name: Login to GovCloud ECR
id: login-govcloud-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push Docker image to Prod, MP and GovCloud ECR
env:
ECR_REGISTRY_PROD: ${{ steps.login-prod-ecr.outputs.registry }}
ECR_REGISTRY_GOVCLOUD: ${{ steps.login-govcloud-ecr.outputs.registry }}
ECR_REGISTRY_MP: ${{ steps.login-mp-ecr.outputs.registry }}
ECR_REPOSITORY: quiltdata/catalog
ECR_REPOSITORY_MP: quilt-data/quilt-payg-catalog
IMAGE_TAG: ${{ github.sha }}
run: |
docker buildx build \
-t $ECR_REGISTRY_PROD/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY_GOVCLOUD/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY_MP/$ECR_REPOSITORY_MP:$IMAGE_TAG \
.
docker push $ECR_REGISTRY_PROD/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY_GOVCLOUD/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY_MP/$ECR_REPOSITORY_MP:$IMAGE_TAG
91 changes: 91 additions & 0 deletions .github/workflows/deploy-lambdas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Deploy lambdas to S3 and ECR

on:
push:
branches:
- master
paths:
- '.github/workflows/deploy-lambdas.yaml'
- 'lambdas/**'

jobs:
deploy-lambda-s3:
strategy:
matrix:
path:
- access_counts
- indexer
- pkgevents
- pkgpush
- preview
- s3hash
- status_reports
- tabular_preview
- transcode
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Build zip
run: |
BUILDER_IMAGE=quiltdata/lambda:build-$(cat lambdas/${{ matrix.path }}/.python-version)
touch ./out.zip
docker run --rm \
--entrypoint /build_zip.sh \
-v "$PWD/lambdas/${{ matrix.path }}":/lambda/function:z \
-v "$PWD/out.zip":/out.zip:z \
-v "$PWD/lambdas/scripts/build_zip.sh":/build_zip.sh:z \
"$BUILDER_IMAGE"
- name: Configure AWS credentials from Prod account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::730278974607:role/github/GitHub-Quilt
aws-region: us-east-1
- name: Upload zips to Prod S3
run: |
s3_key="${{ matrix.path }}/${{ github.sha }}.zip"
./lambdas/scripts/upload_zip.sh ./out.zip "$AWS_REGION" "$s3_key"
- name: Configure AWS credentials from GovCloud account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws-us-gov:iam::313325871032:role/github/GitHub-Quilt
aws-region: us-gov-east-1
- name: Upload zips to GovCloud S3
run: |
s3_key="${{ matrix.path }}/${{ github.sha }}.zip"
./lambdas/scripts/upload_zip.sh ./out.zip "$AWS_REGION" "$s3_key"
deploy-lambda-ecr:
strategy:
matrix:
path:
- thumbnail
runs-on: ubuntu-latest
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Build Docker image
working-directory: ./lambdas/${{ matrix.path }}
run: docker buildx build -t "quiltdata/lambdas/${{ matrix.path }}:${{ github.sha }}" -f Dockerfile .
- name: Configure AWS credentials from Prod account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::730278974607:role/github/GitHub-Quilt
aws-region: us-east-1
- name: Push Docker image to Prod ECR
run: ./lambdas/scripts/upload_ecr.sh 730278974607 "quiltdata/lambdas/${{ matrix.path }}:${{ github.sha }}"
- name: Configure AWS credentials from GovCloud account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws-us-gov:iam::313325871032:role/github/GitHub-Quilt
aws-region: us-gov-east-1
- name: Push Docker image to GovCloud ECR
run: ./lambdas/scripts/upload_ecr.sh 313325871032 "quiltdata/lambdas/${{ matrix.path }}:${{ github.sha }}"
62 changes: 62 additions & 0 deletions .github/workflows/deploy-s3-proxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy S3 Proxy to ECR

on:
push:
branches:
- master
paths:
- .github/workflows/deploy-s3-proxy.yaml
- 's3-proxy/**'

jobs:
deploy-s3-proxy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: s3-proxy
# These permissions are needed to interact with GitHub's OIDC Token endpoint.
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials from Prod account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::730278974607:role/github/GitHub-Quilt
aws-region: us-east-1
- name: Login to Prod ECR
id: login-prod-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Login to MP ECR
id: login-mp-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
registries: 709825985650
- name: Configure AWS credentials from GovCloud account
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws-us-gov:iam::313325871032:role/github/GitHub-Quilt
aws-region: us-gov-east-1
- name: Login to GovCloud ECR
id: login-govcloud-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Build and push Docker image to ECR
env:
ECR_REGISTRY_PROD: ${{ steps.login-prod-ecr.outputs.registry }}
ECR_REGISTRY_GOVCLOUD: ${{ steps.login-govcloud-ecr.outputs.registry }}
ECR_REGISTRY_MP: ${{ steps.login-mp-ecr.outputs.registry }}
ECR_REPOSITORY: quiltdata/s3-proxy
ECR_REPOSITORY_MP: quilt-data/quilt-payg-s3-proxy
IMAGE_TAG: ${{ github.sha }}
run: |
docker buildx build \
-t $ECR_REGISTRY_PROD/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY_GOVCLOUD/$ECR_REPOSITORY:$IMAGE_TAG \
-t $ECR_REGISTRY_MP/$ECR_REPOSITORY_MP:$IMAGE_TAG \
.
docker push $ECR_REGISTRY_PROD/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY_GOVCLOUD/$ECR_REPOSITORY:$IMAGE_TAG
# push to MP last because it can't be re-pushed using the same tag
# so we can re-run the job in case something has failed
docker push $ECR_REGISTRY_MP/$ECR_REPOSITORY_MP:$IMAGE_TAG
15 changes: 6 additions & 9 deletions .github/workflows/js-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ jobs:
defaults:
run:
working-directory: catalog
env:
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.11'
node-version-file: 'catalog/package.json'
cache: 'npm'
cache-dependency-path: 'catalog/package-lock.json'
- run: npm ci
Expand All @@ -27,20 +25,19 @@ jobs:
- env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
run: npm run bundlewatch
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: catalog
name: ${{ github.job }}
lint-docs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: docs
env:
NODE_OPTIONS: --max-old-space-size=4096
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.11'
- run: npx --package=markdownlint-cli markdownlint --ignore node_modules **/*.md
node-version-file: 'catalog/package.json'
- run: npx --package=markdownlint-cli markdownlint .
Loading

0 comments on commit ce36358

Please sign in to comment.