示例#1
0
def create_bucket(bucket_name, dry_run):
    """
    Create a bucket BUCKET_NAME in S3.

    BUCKET_NAME is the name of the bucket to create, s3://BUCKET_NAME
    """
    Cloud.mk_bucket(bucket_name, dry_run)
示例#2
0
def add_user(username, profile):
    """Adds user USERNAME to the user group NimboUserGroup.

    You must have run 'nimbo admin-setup' before adding users.

    PROFILE is the profile name of your root/admin account.
    """
    Cloud.add_user(username, profile)
示例#3
0
def run(job_cmd, dry_run):
    """Runs the JOB_CMD command on an EC2 instance.

    JOB_CMD is any command you would run locally.\n
    E.g. \"python runner.py --epochs=10\".\n
    The command must be between quotes.
    """
    Cloud.run(job_cmd, dry_run)
示例#4
0
def delete_all_instances(dry_run):
    """Terminates all your instances."""
    click.confirm(
        "This will delete all your running instances.\n"
        "Do you want to continue?",
        abort=True,
    )
    Cloud.delete_all_instances(dry_run)
示例#5
0
def spending(qty, timescale, dry_run):
    """Shows daily/monthly spending summary. Costs without credits or refunds applied.

    QTY is the number of days/months you want to see, starting from the current date.\n
    For example:\n
        'nimbo spending 10 days' will show daily spending of the last 10 days\n
        'nimbo spending 3 months' will show the monthly spending of the last 3 months
    """
    Cloud.show_spending(qty, timescale, dry_run)
示例#6
0
def notebook(dry_run):
    """
    Launches jupyter lab on an EC2 instance with your code, data and environment.

    Make sure to run 'nimbo sync-notebooks <instance_id>' frequently to sync
    the notebook to your local folder, as the remote notebooks will be lost
    once the instance is terminated.
    """
    Cloud.run("_nimbo_notebook", dry_run)
示例#7
0
def sync_notebooks(instance_id):
    """
    Syncs the ipynb files from the instance INSTANCE_ID to your local folder.

    Make sure to run 'nimbo sync-notebooks <instance_id>' to sync the notebook
    to your local folder, as the remote notebooks will be lost once the instance
    is terminated.
    """
    Cloud.sync_notebooks(instance_id)
示例#8
0
def push(folder, delete):
    """Push your local datasets/results folder onto S3."""

    if delete:
        click.confirm(
            "This will delete any files that exist in the remote "
            "folder but do not exist in the local folder.\n"
            "Do you want to continue?",
            abort=True,
        )
    Cloud.push(folder, delete)
示例#9
0
def pull(folder, delete):
    """Pull the S3 datasets/results folder into your local computer."""

    if delete:
        click.confirm(
            "This will delete any files that exist in the local "
            "folder but do not exist in the remote folder.\n"
            "Do you want to continue?",
            abort=True,
        )
    Cloud.pull(folder, delete)
示例#10
0
def launch_and_setup(dry_run):
    """
    Launches an EC2 instance with your code, data and environment,
    without running any job.
    """
    Cloud.run("_nimbo_launch_and_setup", dry_run)
示例#11
0
def launch(dry_run):
    """
    Launches an EC2 instance according to your nimbo-config,
    without doing any further setup.
    """
    Cloud.run("_nimbo_launch", dry_run)
示例#12
0
def ssh(instance_id, dry_run):
    """SSH into an instance by INSTANCE_ID."""
    Cloud.ssh(instance_id, dry_run)
示例#13
0
def list_spot_gpu_prices(dry_run):
    """Lists the prices, types, and specs of GPU spot instances."""
    Cloud.ls_spot_gpu_prices(dry_run)
示例#14
0
def allow_current_ip(security_group, dry_run):
    """Adds the IP of the current machine to the allowed inbound rules of GROUP.

    GROUP is the security group to which the inbound rule will be added.
    """
    Cloud.allow_ingress_current_ip(security_group, dry_run)
示例#15
0
def ls(path):
    """List the s3 objects in PATH.

    PATH is an s3 path of the form s3://bucket-name/my/files/path.
    """
    Cloud.ls(path)
示例#16
0
def admin_setup(profile, full_s3_access):
    Cloud.setup(profile, full_s3_access)
示例#17
0
def test_access(dry_run):
    """Runs a mock job to test your config file, permissions, and credentials."""
    Cloud.run_access_test(dry_run)
示例#18
0
def list_active(dry_run):
    """Lists all your active instances."""
    Cloud.ls_active_instances(dry_run)
示例#19
0
def delete_instance(instance_id, dry_run):
    """Terminates an instance by INSTANCE_ID."""
    Cloud.delete_instance(instance_id, dry_run)
示例#20
0
def stop_instance(instance_id, dry_run):
    """Stops an instance by INSTANCE_ID."""
    Cloud.stop_instance(instance_id, dry_run)
示例#21
0
def check_instance_status(instance_id, dry_run):
    """Checks the status of an instance by INSTANCE_ID."""
    print(Cloud.get_instance_status(instance_id, dry_run))
示例#22
0
def list_stopped(dry_run):
    """Lists all your stopped instances."""
    Cloud.ls_stopped_instances(dry_run)