-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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,44 @@ | ||
--- | ||
name: Build ODIS loadtest image | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'dockerfiles/phone-number-privacy/Dockerfile-loadtest' | ||
- 'packages/phone-number-privacy/monitor/**' | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- 'dockerfiles/phone-number-privacy/Dockerfile-loadtest' | ||
- 'packages/phone-number-privacy/monitor/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
odis-loadtest-build-dev: | ||
uses: celo-org/reusable-workflows/.github/workflows/[email protected] | ||
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/odis-loadtest:${{ github.sha }} | ||
if: | | ||
github.ref != 'refs/heads/main' | ||
with: | ||
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect/providers/github-by-repos | ||
service-account: '[email protected]' | ||
artifact-registry: us-west1-docker.pkg.dev/devopsre/dev-images/odis-loadtest | ||
tag: ${{ github.sha }} | ||
context: . | ||
file: dockerfiles/phone-number-privacy/Dockerfile-loadtest | ||
trivy: true | ||
|
||
odis-loadtest-build: | ||
uses: celo-org/reusable-workflows/.github/workflows/[email protected] | ||
name: Build us-west1-docker.pkg.dev/devopsre/social-connect/odis-loadtest:${{ github.sha }} | ||
if: | | ||
github.ref == 'refs/heads/main' | ||
with: | ||
workload-id-provider: projects/1094498259535/locations/global/workloadIdentityPools/gh-social-connect-main/providers/github-by-repos | ||
service-account: '[email protected]' | ||
artifact-registry: us-west1-docker.pkg.dev/devopsre/social-connect/odis-loadtest | ||
tag: ${{ github.sha }} | ||
context: . | ||
file: dockerfiles/phone-number-privacy/Dockerfile-loadtest | ||
trivy: true |
This file contains 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 |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
jobs: | ||
odis-signer-build-dev: | ||
uses: celo-org/reusable-workflows/.github/workflows/[email protected] | ||
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/monorepo:${{ github.sha }} | ||
name: Build us-west1-docker.pkg.dev/devopsre/dev-images/odis-signer:${{ github.sha }} | ||
if: | | ||
github.ref != 'refs/heads/main' | ||
with: | ||
|
@@ -31,7 +31,7 @@ | |
|
||
odis-signer-build: | ||
uses: celo-org/reusable-workflows/.github/workflows/[email protected] | ||
name: Build us-west1-docker.pkg.dev/devopsre/celo-monorepo/monorepo:${{ github.sha }} | ||
name: Build us-west1-docker.pkg.dev/devopsre/social-connect/odis-signer:${{ github.sha }} | ||
if: | | ||
github.ref == 'refs/heads/main' | ||
with: | ||
|
This file contains 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,42 @@ | ||
##### Gathering dependencies | ||
FROM scratch AS packages | ||
|
||
# Copy phone-number-privacy package and its dependency closure. | ||
# Assemble all dependencies into the packages folder so the second stage can select whether to | ||
# include all packages, or just the phone-number-privacy packages. | ||
WORKDIR /celo-phone-number-privacy/ | ||
COPY packages/phone-number-privacy/monitor packages/phone-number-privacy/monitor | ||
COPY packages/phone-number-privacy/common packages/phone-number-privacy/common | ||
COPY packages/sdk/encrypted-backup packages/sdk/encrypted-backup | ||
COPY packages/sdk/identity packages/sdk/identity | ||
|
||
##### Main stage | ||
FROM node:18 | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
|
||
WORKDIR /celo-phone-number-privacy/ | ||
|
||
# Copy monorepo settings | ||
COPY lerna.json package.json yarn.lock ./ | ||
|
||
# Makes build fail if it doesn't copy git, will be removed after build | ||
COPY .git .git | ||
|
||
# Setting ONLY_PUBLISHED_DEPENDENCIES to true or any non-empty string results in only the | ||
# phone-number-privacy package being copied into the image, and therefore it will only build using | ||
# published dependencies. Setting ONLY_PUBLISHED_DEPENDENCIES to "" will copy in all dependecies. | ||
ARG ONLY_PUBLISHED_DEPENDENCIES="" | ||
ARG PACKAGE_SELECTOR=${ONLY_PUBLISHED_DEPENDENCIES:+phone-number-privacy/monitor} | ||
COPY --from=packages celo-phone-number-privacy/packages/${PACKAGE_SELECTOR} packages/${PACKAGE_SELECTOR} | ||
|
||
# Install dependencies and build. | ||
RUN yarn install --network-timeout 100000 --frozen-lockfile && yarn cache clean | ||
RUN yarn build | ||
|
||
RUN rm -r .git | ||
|
||
# Setup and run the signer application. | ||
ENV NODE_ENV production | ||
WORKDIR /celo-phone-number-privacy/packages/phone-number-privacy/monitor | ||
EXPOSE 8080 | ||
ENTRYPOINT ["yarn", "loadTest"] |