Ejemplo n.º 1
0
def test_aci_worker_with_afs():
    resource_group_name = "ACI"
    aci_worker = ACIWorker(resource_group_name)
    container_group_name = "testcontainer"
    container_image_name = "busybox"
    command = ["/bin/sh", "-c", "echo HELLO WORLD from busybox && cat /input/test_file"]
    afs_name, afs_key, afs_share = get_afs_creds()

    aci_worker.run_task_based_container(container_group_name=container_group_name,
                                        container_image_name=container_image_name,
                                        command=command,
                                        afs_name=afs_name,
                                        afs_key=afs_key,
                                        afs_share=afs_share,
                                        afs_mount_subpath='/')
Ejemplo n.º 2
0
def run_job(envs):
    resource_group_name = "SHIP"
    aci_worker = ACIWorker(resource_group_name)
    container_image_name = "mrphys/mfsimage:coMagnetAzure"
    volume_mount_path = "/sample"
    afs_creds = get_afs_creds()
    afs_name = afs_creds["AFS_NAME"]
    afs_key = afs_creds["AFS_KEY"]
    afs_share = afs_creds["AFS_SHARE"]

    container_group_name, logs = aci_worker.run_task_based_container(
        container_image_name=container_image_name,
        #command=command,
        cpu=1.0,
        memory_in_gb=8,
        gpu_count=0,
        volume_mount_path=volume_mount_path,
        envs=envs,
        timeout=28800,
        afs_name=afs_name,
        afs_key=afs_key,
        afs_share=afs_share,
        afs_mount_subpath='')
Ejemplo n.º 3
0
def test_afs_config():
    afs_creds = get_afs_creds()
    print(afs_creds)
Ejemplo n.º 4
0
from cloudhunky.aci_worker import ACIWorker
from cloudhunky.util import get_afs_creds

# In[6]:

import logging

logging.basicConfig(level=logging.INFO)

resource_group_name = "ACI"
aci_worker = ACIWorker(resource_group_name)

container_image_name = "alpine:3.6"
command = ["/bin/sh", "-c", "echo HELLO WORLD from busybox && ls /input"]
volume_mount_path = "/input"
afs_creds = get_afs_creds()
afs_name = afs_creds["AFS_NAME"]
afs_key = afs_creds["AFS_KEY"]
afs_share = afs_creds["AFS_SHARE"]

container_group_name, logs = aci_worker.run_task_based_container(
    container_image_name=container_image_name,
    command=command,
    volume_mount_path=volume_mount_path,
    afs_name=afs_name,
    afs_key=afs_key,
    afs_share=afs_share,
    afs_mount_subpath='')

print("Logs for container '{0}':".format(container_group_name))
print("{0}".format(logs.content))