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: add secret management commands #4764

Merged
merged 9 commits into from
Jun 5, 2024
Merged

feat: add secret management commands #4764

merged 9 commits into from
Jun 5, 2024

Conversation

xianml
Copy link
Contributor

@xianml xianml commented May 30, 2024

What does this PR address?

add secret management commands

1. List
(.venv) ➜  ✗ bentoml  secret list                               
 Secret                                        Created_At                                                      Mount_As                          Keys                                                      Path                                                    
 secret-env                                    2024-05-29 09:16:12                                             env                               IS_TEST, HF_TOKEN                                         -                                                       
 secret-file7                                  2024-05-29 09:15:55                                             env                               IS_TEST                                                   -                                                       
 secret-bcvsz7                                 2024-05-29 08:42:29                                             file                              cacdac                                                    $BENTOML_HOME/aws 
2. Create 
(.venv) ➜  bentoml secret create -n secret-file8 -t file --from-file=.apikey=~/Downloads/github-recovery-codes.txt
Secret secret-file8 created successfully

3. Delete
(.venv) ➜ bentoml secret delete secret-file9                                                                     
Secret secret-file9 deleted successfully

4. Update
(.venv) ➜  bentoml secret apply s-file2 -t file --from-file key1=./auth.lua key2=xxx  -d "mount file test"
Secret s-file2 created successfully

5. Deploy with secrets

bentoml deploy -f - <<EOF
name: jtest-with-secret
bento: jtest:myuy6va6lkcbqiru
services:
  apiserver:
    scaling:
      min_replicas: 1
      max_replicas: 1
    instance_type: cpu.1
  iris_clf:
    scaling:
      min_replicas: 1
      max_replicas: 1
    instance_type: cpu.1
access_authorization: false
secrets:
  - secret-test
EOF
 

Fixes #(issue)

Before submitting:

@xianml xianml requested a review from a team as a code owner May 30, 2024 02:06
@xianml xianml requested review from aarnphm and removed request for a team May 30, 2024 02:06
Copy link

github-actions bot commented May 30, 2024

Code Coverage

Package Statements
bentoml 64.15% (11083 / 17275)
Summary 64.15% (11083 / 17275)

@xianml xianml changed the title [WIP] feat: add secret management commands feat: add secret management commands May 30, 2024
@xianml xianml requested a review from ssheng May 30, 2024 08:34
@xianml xianml force-pushed the feat/secrets branch 3 times, most recently from 9e70508 to 588b436 Compare May 31, 2024 02:03
@xianml xianml requested review from frostming and bojiang May 31, 2024 06:33
@frostming
Copy link
Contributor

Should we merge this to 1.3 branch dev/1.3 instead of main?

@xianml
Copy link
Contributor Author

xianml commented Jun 3, 2024

Should we merge this to 1.3 branch dev/1.3 instead of main?

Agreed.

@xianml xianml changed the base branch from main to dev/1.3 June 3, 2024 03:28
@xianml xianml requested a review from frostming June 4, 2024 10:07
@xianml xianml requested a review from yetone June 4, 2024 10:07
@xianml xianml merged commit 1bc9d3c into dev/1.3 Jun 5, 2024
41 checks passed
@xianml xianml deleted the feat/secrets branch June 5, 2024 07:46
frostming pushed a commit that referenced this pull request Jun 20, 2024
* fix: add secrets management command

* chore: add file type secret

* chore: update command help text

* chore: add deployment option secret

* fix: add delete command

* chore: add secret Apply command

* chore: update mountAs

* chore: update import

* chore: update secret api route
frostming pushed a commit that referenced this pull request Jun 20, 2024
* fix: add secrets management command

* chore: add file type secret

* chore: update command help text

* chore: add deployment option secret

* fix: add delete command

* chore: add secret Apply command

* chore: update mountAs

* chore: update import

* chore: update secret api route
frostming added a commit that referenced this pull request Jun 25, 2024
* feat: support adding response background tasks via bentoml.Context (#4754)

* feat: add secret management commands (#4764)

* fix: add secrets management command

* chore: add file type secret

* chore: update command help text

* chore: add deployment option secret

* fix: add delete command

* chore: add secret Apply command

* chore: update mountAs

* chore: update import

* chore: update secret api route

* feat: get_service api for selected frameworks

Signed-off-by: Frost Ming <me@frostming.com>

* fix: framework importer

Signed-off-by: Frost Ming <me@frostming.com>

* fix: typing import

Signed-off-by: Frost Ming <me@frostming.com>

* fix: deduplicate finder

Signed-off-by: Frost Ming <me@frostming.com>

* doc: update docs

Signed-off-by: Frost Ming <me@frostming.com>

* fix tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix: tests for get_service

Signed-off-by: Frost Ming <me@frostming.com>

* fix: install dependencies

Signed-off-by: Frost Ming <me@frostming.com>

* fix: show dependency tree

Signed-off-by: Frost Ming <me@frostming.com>

* fix: upgrade tensorflow

Signed-off-by: Frost Ming <me@frostming.com>

* fix: dependencies

Signed-off-by: Frost Ming <me@frostming.com>

* fix: catboost test

Signed-off-by: Frost Ming <me@frostming.com>

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Signed-off-by: Frost Ming <me@frostming.com>
Co-authored-by: xianxian.zhang <141706136+xianml@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
frostming added a commit that referenced this pull request Jul 18, 2024
* feat: support adding response background tasks via bentoml.Context (#4754)

* feat: add secret management commands (#4764)

* fix: add secrets management command

* chore: add file type secret

* chore: update command help text

* chore: add deployment option secret

* fix: add delete command

* chore: add secret Apply command

* chore: update mountAs

* chore: update import

* chore: update secret api route

* feat: impl client async endpoints and results (#4768)

* feat: support adding response background tasks via bentoml.Context

Signed-off-by: Frost Ming <me@frostming.com>

* fix: remove init

Signed-off-by: Frost Ming <me@frostming.com>

* fix: reorganize

Signed-off-by: Frost Ming <me@frostming.com>

* fix: cancel the timeout check at the first send

Signed-off-by: Frost Ming <me@frostming.com>

* feat: async task and result

Signed-off-by: Frost Ming <me@frostming.com>

* feat: new route and openapi schema

Signed-off-by: Frost Ming <me@frostming.com>

* feat: retry endpoint

Signed-off-by: Frost Ming <me@frostming.com>

* feat: impl client async endpoints and results

Signed-off-by: Frost Ming <me@frostming.com>

* fix: test client

Signed-off-by: Frost Ming <me@frostming.com>

* fix: rename is_async to is_task

Signed-off-by: Frost Ming <me@frostming.com>

* fix: add timestamp

Signed-off-by: Frost Ming <me@frostming.com>

---------

Signed-off-by: Frost Ming <me@frostming.com>

* feat: external_queue default to 1 when using tasks

Signed-off-by: Frost Ming <me@frostming.com>

* feat: get_service api for selected frameworks (#4782)

* feat: support adding response background tasks via bentoml.Context (#4754)

* feat: add secret management commands (#4764)

* fix: add secrets management command

* chore: add file type secret

* chore: update command help text

* chore: add deployment option secret

* fix: add delete command

* chore: add secret Apply command

* chore: update mountAs

* chore: update import

* chore: update secret api route

* feat: get_service api for selected frameworks

Signed-off-by: Frost Ming <me@frostming.com>

* fix: framework importer

Signed-off-by: Frost Ming <me@frostming.com>

* fix: typing import

Signed-off-by: Frost Ming <me@frostming.com>

* fix: deduplicate finder

Signed-off-by: Frost Ming <me@frostming.com>

* doc: update docs

Signed-off-by: Frost Ming <me@frostming.com>

* fix tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix: tests for get_service

Signed-off-by: Frost Ming <me@frostming.com>

* fix: install dependencies

Signed-off-by: Frost Ming <me@frostming.com>

* fix: show dependency tree

Signed-off-by: Frost Ming <me@frostming.com>

* fix: upgrade tensorflow

Signed-off-by: Frost Ming <me@frostming.com>

* fix: dependencies

Signed-off-by: Frost Ming <me@frostming.com>

* fix: catboost test

Signed-off-by: Frost Ming <me@frostming.com>

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Signed-off-by: Frost Ming <me@frostming.com>
Co-authored-by: xianxian.zhang <141706136+xianml@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: cli auto login (#4817)

* chore: support cli auto login

* feat: add auth server

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

* chore: fix by comments

* chore: encode uri

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

* chore: add cors

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

* chore: clean unused code

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

* chore: clean unused code

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: use rich.print to replace click.echo (#4827)

* chore: update print and fix cors error (#4829)

* feat: login to current context instead of default context if --context is not passed (#4828)

* feat: switch to uv as the resolver and installer (#4822)

* feat: switch to uv

Signed-off-by: Frost Ming <me@frostming.com>

* feat: Officially support Python 3.12 (#4830)

* Docs: Add auto cli login docs (#4844)

Add auto cli login docs

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* doc: Fix typo and format (#4821)

Fix typo and format

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* fix(cli): hanging issue when deployment ready (#4825)

* fix(cli): hanging issue when deployment ready

Signed-off-by: Frost Ming <me@frostming.com>

* fix(deployment-client): add build process and extend url (#4790)

* fix(deployement-client): add build process and extend url

* chore: mute if not using cli

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Frost Ming <me@frostming.com>
Signed-off-by: Frost Ming <me@frostming.com>

* doc: Update vllm.rst (#4824)

Update vllm.rst

* docs: Add custom models use case doc (#4819)

* Add custom models use case doc

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

* Update examples/xgboost/save_model.py

Co-authored-by: Frost Ming <mianghong@gmail.com>

* Update examples/mlflow/save_model.py

---------

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Frost Ming <mianghong@gmail.com>
Signed-off-by: Frost Ming <me@frostming.com>

* docs: Reorg blip doc to multimodality section (#4826)

Reorg blip doc to multimodality section

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* fix: inject prometheus multiproc_dir into env var when worker starts (#4820)

* fix: inject prometheus multiproc_dir into env var when worker starts

Signed-off-by: Frost Ming <me@frostming.com>

* fix: remove unneeded tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix: tests

Signed-off-by: Frost Ming <me@frostming.com>

* fix: replace bentoml.metrics with prometheus_client

Signed-off-by: Frost Ming <me@frostming.com>

---------

Signed-off-by: Frost Ming <me@frostming.com>

* docs: Add logging and tracing docs (#4725)

* Add logging and tracing docs

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* Fix format

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* feat: --label option for bentoml build (#4832)

* feat: --label option for bentoml build

Signed-off-by: Frost Ming <me@frostming.com>

* docs: Update the concurrency doc (#4834)

* Update the concurrency doc

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* Update descriptions

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

---------

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* docs: Update services.rst  (#4837)

Update services.rst

In the Python classes I changed the reference to the class to `self` from `this`. `this` is not a keyword in Python

* docs: Update concurrency links (#4840)

Update concurrency links

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* docs: Fix broken link (#4841)

Fix broken link

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* ci: pre-commit autoupdate [skip ci] (#4838)

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.7 → v0.5.0](astral-sh/ruff-pre-commit@v0.4.7...v0.5.0)
- [github.com/pdm-project/pdm: 2.15.4 → 2.16.1](pdm-project/pdm@2.15.4...2.16.1)
- [github.com/bufbuild/buf: v1.32.2 → v1.34.0](bufbuild/buf@v1.32.2...v1.34.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* doc: Fix typo and format (#4821)

Fix typo and format

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>
Signed-off-by: Frost Ming <me@frostming.com>

* fix: stop spinner before starting to stream logs (#4846)

Signed-off-by: Frost Ming <me@frostming.com>

* docs: Add azure byoc setup doc (#4847)

* Add azure byoc step doc

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* Fix space

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Update azure.rst

* docs: Update the BYOC architecture image (#4848)

Update the BYOC architecture image

Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>

* update lock file

Signed-off-by: Frost Ming <me@frostming.com>

* feat: retry and cancel task (#4852)

* fix: options are not required (#4861)

* fix: options are not required

* ci: auto fixes from pre-commit.ci

For more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix: don't fail when image pod is not found (#4862)

* fix: async task response deserialization crash (#4865)

* fix: raise deploy timeout to 1hr

Signed-off-by: Frost Ming <me@frostming.com>

* fix: remove references to yatai from cli help

Signed-off-by: Frost Ming <me@frostming.com>

* feat: change spinner text on status change and show spinner after image build done (#4867)

Signed-off-by: Frost Ming <me@frostming.com>

* fix: do not raise deployment pods not found error (#4868)

* fix: console print

Signed-off-by: Frost Ming <me@frostming.com>

---------

Signed-off-by: Frost Ming <me@frostming.com>
Signed-off-by: Sherlock113 <sherlockxu07@gmail.com>
Co-authored-by: xianxian.zhang <141706136+xianml@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sherlock Xu <65327072+Sherlock113@users.noreply.github.com>
Co-authored-by: Steve Guo <44340365+Haivilo@users.noreply.github.com>
Co-authored-by: Vikramjit Sidhu <vikram.sidhu.007@gmail.com>
Co-authored-by: yetone <yetoneful@gmail.com>
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.

4 participants