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: prepare for pypi distribution #180

Merged
merged 5 commits into from
Feb 20, 2025
Merged

Feat: prepare for pypi distribution #180

merged 5 commits into from
Feb 20, 2025

Conversation

dapineyro
Copy link
Collaborator

@dapineyro dapineyro commented Feb 19, 2025

Overview

This PR adds the necessary changes to be able to upload this repository to PyPI.

Jira

https://lifebit.atlassian.net/browse/LP-30465

Changes

  • The name of the module has changed from cloudos to cloudos_cli. This was necessary as there is already an unrelated cloudos repo in PyPI. This implies:
    • "cloudos" folder has renamed to "cloudos_cli"
    • When importing the module, the import expression should be import cloudos_cli.XXX
  • Added GPLv3+ License: it allows free distribution, free usage (even for private users). The only restriction is to re-pack the software and sell it, which is not permitted.
  • There were some modifications in setup.py to correctly build the repo for pip

Tests

Install from PIP

# Create a new venv
python -m venv ~/path/to/my/venvs/testpip
source ~/path/to/my/venvs/testpip/bin/activate
# update pip (just in case)
pip install --upgrade pip
# Install cloudos-cli
pip install cloudos-cli

Create some bash variables

CLOUDOS="https://cloudos.lifebit.ai"
MY_API_KEY="xxx"
WORKSPACE_ID="5c6d3e9bd954e800b23f8c62"
PROJECT_NAME="API jobs"
WORKFLOW_NAME="rnatoy"
P1="reads=s3://lifebit-featured-datasets/pipelines/rnatoy-data"
P2="genome=s3://lifebit-featured-datasets/pipelines/rnatoy-data/ggal_1_48850000_49020000.Ggal71.500bpflank.fa"
P3="annot=s3://lifebit-featured-datasets/pipelines/rnatoy-data/ggal_1_48850000_49020000.bed.gff"
JOB_NAME="Test_PIP_cloudos_cli"

Launch a job

cloudos job run \
    --cloudos-url $CLOUDOS \
    --apikey $MY_API_KEY \
    --workspace-id $WORKSPACE_ID \
    --project-name "$PROJECT_NAME" \
    --workflow-name $WORKFLOW_NAME \
    -p $P1 \
    -p $P2 \
    -p $P3 \
    --job-name $JOB_NAME
Screenshot 2025-02-20 at 16 30 54 Screenshot 2025-02-20 at 16 30 35

Check job status

job_id="67b74a796ccfc5767c5794b7"
cloudos job status \
    --apikey $MY_API_KEY \
    --cloudos-url $CLOUDOS \
    --job-id $job_id
Screenshot 2025-02-20 at 16 31 22

Get Job List CSV

cloudos job list \
    --cloudos-url $CLOUDOS \
    --apikey $MY_API_KEY \
    --workspace-id $WORKSPACE_ID
Screenshot 2025-02-20 at 16 31 46

Get workflow list CSV

cloudos workflow list \
    --cloudos-url $CLOUDOS \
    --apikey $MY_API_KEY \
    --workspace-id $WORKSPACE_ID
Screenshot 2025-02-20 at 16 32 12

Get projects list

cloudos project list \
    --cloudos-url $CLOUDOS \
    --apikey $MY_API_KEY \
    --workspace-id $WORKSPACE_ID
Screenshot 2025-02-20 at 16 32 37

Import a module into Python script

python
import cloudos_cli.clos as cl
Screenshot 2025-02-20 at 16 32 55

@dapineyro dapineyro marked this pull request as ready for review February 20, 2025 12:04
@dapineyro dapineyro marked this pull request as draft February 20, 2025 12:10
@dapineyro dapineyro marked this pull request as ready for review February 20, 2025 12:10
Copy link
Contributor

@danielboloc danielboloc left a comment

Choose a reason for hiding this comment

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

LGTM!

@dapineyro dapineyro merged commit 17062bc into main Feb 20, 2025
7 checks passed
@dapineyro dapineyro deleted the pip_upload branch February 20, 2025 16:38
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