-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
f89e898
commit 1ea06d3
Showing
16 changed files
with
320 additions
and
124 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
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
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,26 @@ | ||
FROM python:3-slim AS builder | ||
RUN pip install poetry==1.8.2 | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /app | ||
COPY pyproject.toml poetry.lock ./ | ||
COPY main.py ./ | ||
RUN poetry install --no-root && rm -rf $POETRY_CACHE_DIR | ||
|
||
# A distroless container image with Python and some basics like SSL certificates | ||
# https://github.com/GoogleContainerTools/dis/i/itroless | ||
FROM gcr.io/distroless/python3-debian12 | ||
|
||
ENV VIRTUAL_ENV=/app/.venv \ | ||
PATH="/app/.venv/bin:$PATH" | ||
|
||
COPY --from=builder /app /app | ||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
|
||
WORKDIR /app | ||
ENV PYTHONPATH /app | ||
CMD ["/app/main.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,2 @@ | ||
# gcp-gsm-parse-secrets | ||
Converts a lists of strings of secrets references into screaming snake case. Look at the tests.py for furhter details. |
File renamed without changes.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,15 @@ | ||
[tool.poetry] | ||
name = "gcp-gsm-parse-secrets" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Jan Max Tiedemann <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.10" | ||
typer = "^0.12.5" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,57 @@ | ||
# gcp-gsm-load-secrets | ||
|
||
This action is set to replace GitHub actions integrated secret management. | ||
|
||
## Usage | ||
|
||
To load a secret from GSM figure out the following: | ||
|
||
- check if the repository has access to the secret | ||
- repository is owned by bakdata | ||
- repository is private | ||
- even if the labels are correctly set, you will need to run Terraform to set the proper roles | ||
- *TBD* | ||
- use this template: | ||
|
||
```yaml | ||
- name: Load secrets | ||
id: load-secrets | ||
uses: bakdata/ci-templates/actions/gcp-gsm-load-secrets | ||
with: | ||
gke-project-name: <can be found from gcp console> | ||
gke-project-id: <can be found from gcp console> | ||
secrets-to-inject: |- | ||
<secret_name>/<optional version, if not set the latest version is loaded> | ||
<other_secret>/<optional version, if not set the latest version is loaded> | ||
``` | ||
- it is possible to load multiple secrets in the same call | ||
- loaded secrets will be injected as environment variables and the name will be cannonicalized to SCREAMING_SNAKE_CASE. Example: `i-like_trains__why_this?` -> `I_LIKE_TRAINS_WHY_THIS` | ||
|
||
## References | ||
|
||
### Inputs | ||
|
||
<!-- AUTO-DOC-INPUT:START - Do not remove or modify this section --> | ||
|
||
| INPUT | TYPE | REQUIRED | DEFAULT | DESCRIPTION | | ||
| -------------------------- | ------ | -------- | -------- | --------------------------------------------- | | ||
| export-to-environment | string | false | `"true"` | Export secrets to environment | | ||
| gke-project-name | string | true | | GKE project name for authentication | | ||
| gke-service-account | string | true | | GKE service account for authentication | | ||
| secrets-to-inject | string | true | | Secrets to inject into the environment | | ||
| workload-identity-provider | string | true | | Workload identity provider for authentication | | ||
|
||
<!-- AUTO-DOC-INPUT:END --> | ||
|
||
### Outputs | ||
|
||
<!-- AUTO-DOC-OUTPUT:START - Do not remove or modify this section --> | ||
|
||
| OUTPUT | TYPE | DESCRIPTION | | ||
| ------- | ------ | ---------------------------------- | | ||
| secrets | string | Secrets loaded from Secret Manager | | ||
|
||
<!-- AUTO-DOC-OUTPUT:END --> | ||
|
||
### Secrets |
Oops, something went wrong.