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

Use environment variable for passing the private key password #2094

Merged
merged 8 commits into from
Oct 27, 2023

Conversation

angrybayblade
Copy link
Contributor

Proposed changes

  • Deprecates --password flag
  • Introduces OPEN_AUTONOMY_PRIVATE_KEY_PASSWORD as environment variable for passing private key password

Fixes

If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce? (A breaking change is a fix or feature that would cause existing functionality and APIs to not work as expected.)
Put an x in the box that applies

  • Non-breaking fix (non-breaking change which fixes an issue)
  • Breaking fix (breaking change which fixes an issue)
  • Non-breaking feature (non-breaking change which adds functionality)
  • Breaking feature (breaking change which adds functionality)
  • Refactor (non-breaking change which changes implementation)
  • Messy (mixture of the above - requires explanation!)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the main branch (left side). Also you should start your branch off our main.
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have locally run services that could be impacted and they do not present failures derived from my changes
  • Public-facing documentation has been updated with the changes affected by this PR. Even if the provided contents are not in their final form, all significant information must be included.
  • Any backwards-incompatible/breaking change has been clearly documented in the upgrading document.

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9f411b1) 94.14% compared to head (d0daab8) 94.14%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2094   +/-   ##
=======================================
  Coverage   94.14%   94.14%           
=======================================
  Files         255      255           
  Lines       15789    15783    -6     
=======================================
- Hits        14864    14859    -5     
+ Misses        925      924    -1     
Flag Coverage Δ
unittests 94.14% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
autonomy/cli/deploy.py 100.00% <ø> (ø)
autonomy/cli/helpers/deployment.py 87.85% <ø> (ø)
autonomy/deploy/base.py 100.00% <100.00%> (+0.68%) ⬆️
autonomy/deploy/build.py 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +613 to +614
if self.deplopyment_type == DOCKER_COMPOSE_DEPLOYMENT:
agent_vars[ENV_VAR_AEA_PASSWORD] = "$OPEN_AUTONOMY_PRIVATE_KEY_PASSWORD"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will store the value of AEA_PASSWORD as $OPEN_AUTONOMY_PRIVATE_KEY_PASSWORD in the docker-compose.yaml so the user can pass the password as OPEN_AUTONOMY_PRIVATE_KEY_PASSWORD when running the deployment

Comment on lines +616 to +618
agent_vars[ENV_VAR_AEA_PASSWORD] = os.environ.get(
"OPEN_AUTONOMY_PRIVATE_KEY_PASSWORD", ""
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately the kubernetes does not provide such functionalities so we'll have to store them the old way

@angrybayblade angrybayblade merged commit 32bedb3 into main Oct 27, 2023
24 checks passed
@DavidMinarsch DavidMinarsch deleted the fix/password-as-env-var branch November 25, 2023 23:21
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