Skip to content
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

Feat: Build secrets #792

Merged
merged 7 commits into from
Dec 18, 2024
Merged

Feat: Build secrets #792

merged 7 commits into from
Dec 18, 2024

Conversation

dleviminzi
Copy link
Collaborator

@dleviminzi dleviminzi commented Dec 18, 2024

Resolve BE-2149

This PR adds support for referencing secrets during builds.

First, create a secret.

beta9 secret create TEST TEST

Then, use with_secrets to flag that you would like it to be available during the build.

from beta9 import Image, endpoint

image = (
    Image()
    .with_secrets(["TEST"])
    .add_commands(
        [
            "echo $TEST",
        ]
    )
)


@endpoint(image=image, name="secret-test")
def handler():
    return "pass"

The build logs will look like this:

=> Building image 
Waiting for build container to start...
Python 3.10.16
TEST
...

@dleviminzi dleviminzi marked this pull request as ready for review December 18, 2024 04:29
@dleviminzi dleviminzi requested a review from jsun-m December 18, 2024 17:22
pkg/worker/runc_server.go Outdated Show resolved Hide resolved
@dleviminzi dleviminzi merged commit b35b93b into main Dec 18, 2024
3 checks passed
@dleviminzi dleviminzi deleted the dlm/with-secrets branch December 18, 2024 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants