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

cli-upload #81

Merged
merged 17 commits into from Jun 16, 2022
Merged

cli-upload #81

merged 17 commits into from Jun 16, 2022

Conversation

georgosgeorgos
Copy link
Contributor

@georgosgeorgos georgosgeorgos commented Jun 10, 2022

cli-upload

Add upload functionality to the command line. It gives the user the possibility to upload specific artifacts on a server.

Given a specific version for an algorithm:

  • check if that version is already on the server:
    - check if the folder bucket/algorithm_type/algorithm_name/algorithm_application/version/ exists.
  • If yes, tell the user and stop the upload.
  • If not, upload all the files in that version.

cli-upload relies on minio and has been tested locally using docker-compose.
cli-upload can be used to upload on a cloud or local server.


How to use cli-upload

Following the example in the README (in the Saving a trained algorithm for inference via the CLI command section) and assuming a trained model in /tmp/test_cli_upload, run:

gt4sd-upload --training_pipeline_name paccmann-vae-trainer --model_path /tmp/test_cli_upload --training_name fast-example --target_version fast-example-v0 --algorithm_application PaccMannGPGenerator

@cla-bot
Copy link

cla-bot bot commented Jun 10, 2022

Thanks a lot for working on GT4SD, we strongly value contributions from our users. It appears one of the commiters in the PR did not sign the CLA for contributors. To do so, you can open an issue to sign the CLA clicking here. More details can be found here.

1 similar comment
@cla-bot
Copy link

cla-bot bot commented Jun 10, 2022

Thanks a lot for working on GT4SD, we strongly value contributions from our users. It appears one of the commiters in the PR did not sign the CLA for contributors. To do so, you can open an issue to sign the CLA clicking here. More details can be found here.

Copy link
Contributor

@drugilsberg drugilsberg left a comment

Choose a reason for hiding this comment

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

@georgosgeorgos amazing work, see my comments, mostly minor changes/refactor and points of discussion.

requirements.txt Outdated Show resolved Hide resolved
src/gt4sd/algorithms/core.py Outdated Show resolved Hide resolved
src/gt4sd/s3.py Outdated Show resolved Hide resolved
src/gt4sd/s3.py Outdated Show resolved Hide resolved
Add cli-upload.

Signed-off-by: Giorgio Giannone <giorgio.giannone@ibm.com>
@cla-bot
Copy link

cla-bot bot commented Jun 13, 2022

Thanks a lot for working on GT4SD, we strongly value contributions from our users. It appears one of the commiters in the PR did not sign the CLA for contributors. To do so, you can open an issue to sign the CLA clicking here. More details can be found here.

@cla-bot cla-bot bot added the cla-signed CLA has been signed label Jun 13, 2022
Signed-off-by: Giorgio Giannone <giorgio.giannone@ibm.com>
@georgosgeorgos
Copy link
Contributor Author

For the moment we don't have a direct way (for example os.environ) to use environment variables in configuration.py

@drugilsberg
Copy link
Contributor

For the moment we don't have a direct way (for example os.environ) to use environment variables in configuration.py

The BaseSettings from pedantic are directly initialized from the env variables (where the upper case env var is read into the corresponding lower case class attribute).
To access those simply add the the to the configuration object and instantiate it. I hope this helps.

drugilsberg and others added 2 commits June 14, 2022 15:29
Signed-off-by: georgosgeorgos <giorgio.giannone@ibm.com>
Copy link
Contributor

@drugilsberg drugilsberg left a comment

Choose a reason for hiding this comment

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

We are getting there :)

src/gt4sd/algorithms/core.py Outdated Show resolved Hide resolved
docs/source/gt4sd_server_upload_md.md Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
@georgosgeorgos
Copy link
Contributor Author

The BaseSettings from pedantic are directly initialized from the env variables (where the upper case env var is read into the corresponding lower case class attribute). To access those simply add the the to the configuration object and instantiate it. I hope this helps.

Fixed it. Thanks.

When using upload functionality locally, the server can be http and we need gt4sd_s3_secure=False in configuration.py.
I tried setting an environment variable GT4SD_S3_SECURE="False" and then use gt4sd_s3_secure: bool = distutils.util.strtobool("True") as default in configuration.py.
This works, but raises an error in one of the checks and I removed it. So at the moment the user has to manually change the value in configuration.py

@drugilsberg
Copy link
Contributor

The BaseSettings from pedantic are directly initialized from the env variables (where the upper case env var is read into the corresponding lower case class attribute). To access those simply add the the to the configuration object and instantiate it. I hope this helps.

Fixed it. Thanks.

When using upload functionality locally, the server can be http and we need gt4sd_s3_secure=False in configuration.py. I tried setting an environment variable GT4SD_S3_SECURE="False" and then use gt4sd_s3_secure: bool = distutils.util.strtobool("True") as default in configuration.py. This works, but raises an error in one of the checks and I removed it. So at the moment the user has to manually change the value in configuration.py

in principle the strtobool is not needed, you can simply set gt4sd_s3_secure: bool = True and define export GT4SD_S3_SECURE-false and it should work right away.

Signed-off-by: georgosgeorgos <giorgio.giannone@ibm.com>
README.md Outdated Show resolved Hide resolved
docs/source/gt4sd_server_upload_md.md Show resolved Hide resolved
docs/source/gt4sd_server_upload_md.md Show resolved Hide resolved
docs/index.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
src/gt4sd/configuration.py Outdated Show resolved Hide resolved
@cla-bot
Copy link

cla-bot bot commented Jun 15, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: GitHub Action.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot bot removed the cla-signed CLA has been signed label Jun 15, 2022
@cla-bot
Copy link

cla-bot bot commented Jun 15, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: GitHub Action.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link

cla-bot bot commented Jun 15, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: GitHub Action.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link

cla-bot bot commented Jun 15, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: GitHub Action.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@drugilsberg drugilsberg marked this pull request as ready for review June 15, 2022 14:23
Copy link
Contributor

@drugilsberg drugilsberg left a comment

Choose a reason for hiding this comment

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

Last bit, then it's good to go

README.md Outdated Show resolved Hide resolved
Signed-off-by: georgosgeorgos <giorgio.giannone@ibm.com>
@cla-bot
Copy link

cla-bot bot commented Jun 15, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: GitHub Action.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@georgosgeorgos
Copy link
Contributor Author

There is a problem with GitHub Action related to this issue - actions/runner#667. Thanks @jannisborn for finding it.

Minor update of upload customization.
@cla-bot
Copy link

cla-bot bot commented Jun 15, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: GitHub Action.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Copy link
Contributor

@drugilsberg drugilsberg left a comment

Choose a reason for hiding this comment

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

Added a minor rephrasing in the docs. Good to go, besides the CLA issue.

@cla-bot
Copy link

cla-bot bot commented Jun 16, 2022

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: GitHub Action.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@jannisborn jannisborn merged commit 94e5f7a into GT4SD:main Jun 16, 2022
@georgosgeorgos georgosgeorgos deleted the cli-upload branch June 16, 2022 13:32
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.

None yet

3 participants