-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build action.yml Dockerfile Savepoint
- Loading branch information
Showing
3 changed files
with
101 additions
and
0 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,21 @@ | ||
name: Deploy modules | ||
|
||
on: | ||
push: | ||
branches: | ||
- ghactions | ||
|
||
jobs: | ||
|
||
build-modules: | ||
runs-on: ubuntu-latest | ||
name: Loadmaster | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Package step | ||
uses: ./ | ||
id: build-package | ||
|
||
|
||
|
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,27 @@ | ||
# gcr.io/distroless/python3-debian11 (runtime env is using 3.9 and that's imporatant for native dependencies) | ||
FROM python:3.9-slim AS builder | ||
|
||
WORKDIR / | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Poetry setup | ||
RUN pip3 install poetry | ||
RUN poetry config virtualenvs.create false | ||
|
||
COPY poetry.lock . | ||
COPY pyproject.toml . | ||
|
||
RUN poetry config virtualenvs.create false | ||
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes | ||
RUN pip3 install --target=/app -r requirements.txt --no-deps | ||
|
||
# Keep the same folder structure for imports | ||
COPY cognite/transformations_cli/ /app/cognite/transformations_cli/ | ||
|
||
# A distroless container image with Python and some basics like SSL certificates | ||
# https://github.com/GoogleContainerTools/distroless | ||
FROM gcr.io/distroless/python3-debian11 | ||
COPY --from=builder /app /app | ||
ENV PYTHONPATH /app | ||
ENTRYPOINT [ "python", "/app/build.py" ] |
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,53 @@ | ||
name: 'Deploy to Transformations' | ||
description: 'Deploy a set of transformations to Transformations from yaml manifests' | ||
inputs: | ||
api-key: | ||
description: 'API key for authenticating with Transformations' | ||
required: false | ||
token-url: | ||
description: 'Token url to use for fetching OAuth2 tokens' | ||
required: false | ||
cdf-project-name: | ||
description: 'CDF project name (only required when using OAuth2 credentials)' | ||
required: false | ||
scopes: | ||
description: 'List of OAuth2 scopes (space separated)' | ||
required: false | ||
audience: | ||
description: 'OAuth2 audience' | ||
required: false | ||
client-id: | ||
description: 'OAuth2 client ID' | ||
required: false | ||
client-secret: | ||
description: 'OAuth2 client secret' | ||
required: false | ||
cluster: | ||
description: 'CDF Cluster' | ||
required: false | ||
default: 'europe-west1-1' | ||
path: | ||
description: >- | ||
The path to a directory containing transformation manifests. | ||
This is relative to $GITHUB_WORKSPACE, | ||
which will be the root of the repository when using actions/checkout with default settings. | ||
required: true | ||
legacy-mode: | ||
description: 'Parse transformation manifests in legacy mode' | ||
required: false | ||
default: "false" | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
env: | ||
TRANSFORMATIONS_API_KEY: ${{ inputs.api-key }} | ||
TRANSFORMATIONS_TOKEN_URL: ${{ inputs.token-url }} | ||
TRANSFORMATIONS_PROJECT: ${{ inputs.cdf-project-name }} | ||
TRANSFORMATIONS_CLIENT_ID: ${{ inputs.client-id }} | ||
TRANSFORMATIONS_CLIENT_SECRET: ${{ inputs.client-secret }} | ||
TRANSFORMATIONS_SCOPES: ${{ inputs.scopes }} | ||
TRANSFORMATIONS_AUDIENCE: ${{ inputs.audience }} | ||
TRANSFORMATIONS_CLUSTER: "${{ inputs.cluster }}" | ||
TRANSFORMATIONS_LEGACY_MODE: ${{ inputs.legacy-mode }} | ||
args: ["deploy", "${{ inputs.path }}" , "--debug"] | ||
|