jupyter-naas/naas-python

feat: Implement storage with naas-python

Closed this issue ยท 3 comments

We need to implement the Object Storage API for both the CLI and the SDK.

We should leverage boto3 as must as possible to deal with the uploads rather than our own endpoint if possible.

The naas-python cli must handle AWS credentials silently, so we could use the file ~/.naas/credentials to store AWS credentials of a specific workspace/storage pair.

For example:

{
    "jwt_token": "...",
    "storage": {
        "cfda6ebb-1ea9-4668-a7e5-c599a66caf8c": {
            "test": {
                "REGION_NAME": "...",
                "AWS_ACCESS_KEY_ID": "...",
                "AWS_SECRET_ACCESS_KEY": "...",
                "AWS_SESSION_TOKEN": "..."
            }
        }
    }
}

The command to put an object should be:

naas-python storage put-object -w=cfda6ebb-1ea9-4668-a7e5-c599a66caf8c -s=test /home/myuser/monfichier.txt /my/custom/directory/monfichier.txt

Bonus:

It would be awesome, to be able to select the active workspace, likes Kubectl/oc are doing, by running:

naas-python workspace use cfda6ebb-1ea9-4668-a7e5-c599a66caf8c

So it should be possible to do the following:

naas-python workspace cfda6ebb-1ea9-4668-a7e5-c599a66caf8c
naas-python storage put-object -s=test /home/myuser/monfichier.txt /my/custom/directory/monfichier.txt

Now I don't have to specify the workspace everytime.

๐ŸŽ‰ This issue has been resolved in version 1.2.0-dev.7 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 1.4.0-dev.1 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 1.4.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€