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

fix stacktrace w/no args, minor version bump #120

Merged

Conversation

shaneknapp
Copy link
Contributor

@shaneknapp shaneknapp commented Jan 24, 2025

when running hubploy with no args, it would stacktrace. this fixes it.

before:

(dh) ➜  hubploy git:(main) hubploy
Traceback (most recent call last):
  File "/Users/sknapp/miniconda3/envs/dh/bin/hubploy", line 8, in <module>
    sys.exit(main())
  File "/Users/sknapp/miniconda3/envs/dh/lib/python3.10/site-packages/hubploy/__main__.py", line 138, in main
    if args.helm_debug or args.dry_run:
AttributeError: 'Namespace' object has no attribute 'dry_run'

after:

(dh) ➜  hubploy git:(fix-no-args-stacktrace) ✗ hubploy
usage: hubploy [-h] [-d] [-D] [-v] {deploy} ...

positional arguments:
  {deploy}
    deploy          Deploy a chart to the given environment.

options:
  -h, --help        show this help message and exit
  -d, --debug       Enable tool debug output (not including helm debug).
  -D, --helm-debug  Enable Helm debug output. This is not allowed to be used in a CI environment due to secrets being displayed in plain text, and the script will exit. To enable this option, set a local environment varible HUBPLOY_LOCAL_DEBUG=true
  -v, --verbose     Enable verbose output.

@shaneknapp
Copy link
Contributor Author

shaneknapp commented Jan 24, 2025

we can safely ignore the changes to the docs folder from the second commit (df971e0) as that was an artifact from running ruff format on my local device.

@shaneknapp
Copy link
Contributor Author

shaneknapp commented Jan 24, 2025

tested locally deploying a11y:

(dh) ➜  datahub git:(staging) pip list|grep hubploy
hubploy                       0.4.2       /Users/sknapp/src/hubploy
(dh) ➜  datahub git:(staging) git checkout staging && git fetch --prune --all && git rebase --stat upstream/staging && git push origin staging
Already on 'staging'
Your branch is up to date with 'upstream/staging'.
Fetching upstream
Fetching origin
Current branch staging is up to date.
Everything up-to-date
(dh) ➜  datahub git:(staging) hubploy -v deploy a11y hub staging
INFO:hubploy.__main__:Namespace(command='deploy', debug=False, helm_debug=False, verbose=True, deployment='a11y', chart='hub', environment='staging', namespace=None, set=None, set_string=None, version=None, timeout=None, force=False, atomic=False, cleanup_on_fail=False, dry_run=False, image_overrides=None)
INFO:hubploy.helm:Deploying a11y to staging
INFO:hubploy.helm:Getting image and deployment config for a11y
INFO:hubploy.config:Loading hubploy config from /Users/sknapp/src/datahub/deployments/a11y/hubploy.yaml
INFO:hubploy.config:Tag for us-central1-docker.pkg.dev/ucb-datahub-2018/user-images/a11y-user-image: 6dcc885aabf9
INFO:hubploy.helm:Using image us-central1-docker.pkg.dev/ucb-datahub-2018/user-images/a11y-user-image:6dcc885aabf9 for jupyterhub.singleuser.image
INFO:hubploy.auth:Getting auth config for a11y
INFO:hubploy.config:Loading hubploy config from /Users/sknapp/src/datahub/deployments/a11y/hubploy.yaml
INFO:hubploy.config:Tag for us-central1-docker.pkg.dev/ucb-datahub-2018/user-images/a11y-user-image: 6dcc885aabf9
INFO:hubploy.auth:Attempting to authenticate with gcloud...
INFO:hubploy.auth:Decrypting deployments/a11y/secrets/gke-key.json
INFO:hubploy.auth:File is sops encrypted, decrypting...
INFO:hubploy.auth:Activating service account for ucb-datahub-2018
Activated service account credentials for: [hubploy@ucb-datahub-2018.iam.gserviceaccount.com]
INFO:hubploy.auth:Getting credentials for spring-2024 in us-central1
Fetching cluster endpoint and auth data.
kubeconfig entry generated for spring-2024.
INFO:hubploy.helm:Deploying a11y-staging in namespace a11y-staging
Getting updates for unmanaged Helm repositories...
...Successfully got an update from the "https://jupyterhub.github.io/helm-chart/" chart repository
Saving 1 charts
Downloading jupyterhub from repo https://jupyterhub.github.io/helm-chart/
Deleting outdated charts
INFO:hubploy.helm:Loaded kubeconfig: /var/folders/7l/bjg7qcmx6h98xhmxxpy5gcq80000gn/T/tmp4bl0n5v2
INFO:hubploy.helm:Running helm upgrade on a11y-staging.
Release "a11y-staging" has been upgraded. Happy Helming!
NAME: a11y-staging
LAST DEPLOYED: Fri Jan 24 11:02:00 2025
NAMESPACE: a11y-staging
STATUS: deployed
REVISION: 278
TEST SUITE: None

Copy link
Contributor

@ryanlovett ryanlovett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@shaneknapp shaneknapp merged commit bc49f8c into berkeley-dsep-infra:main Jan 27, 2025
1 check passed
@shaneknapp shaneknapp deleted the fix-no-args-stacktrace branch January 27, 2025 21:19
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.

2 participants