Exemplo n.º 1
0
def get_job_item_download_url(job_item_key):
    job_item = get_job_item_doc(job_item_key)
    s3_key = job_item['output_dir'] + "/" + job_item['output_filename']
    s3_conn = s3.S3Connection(VAA3D_USER_AWS_ACCESS_KEY,
                              VAA3D_USER_AWS_SECRET_KEY)
    link_expiry_secs = 3600  # 1 hour
    return s3.get_download_url(s3_conn, S3_OUTPUT_BUCKET, s3_key,
                               link_expiry_secs)
Exemplo n.º 2
0
def get_job(job_id):
	job = Job.query.get(job_id)
	job_dict = job.as_dict()
	job_dict['job_status'] = job.job_status.status_name
	link_expiry_secs = 3600 # 1 hour
	s3_conn = s3.S3Connection(VAA3D_USER_AWS_ACCESS_KEY, VAA3D_USER_AWS_SECRET_KEY)
	job_dict['download_url'] = s3.get_download_url(s3_conn, S3_OUTPUT_BUCKET, 
		job.get_output_s3_key(), link_expiry_secs)
	return job_dict	
Exemplo n.º 3
0
def get_job_items(job_id, include_zip=True):
	dynamo_conn = dynamo.get_connection()
	table = dynamo.get_table(dynamo_conn, DYNAMO_JOB_ITEMS_TABLE)
	job_items = dynamo.query_all(table, "job_index", "job_id", job_id)
	link_expiry_secs = 3600 # 1 hour
	s3_conn = s3.S3Connection(VAA3D_USER_AWS_ACCESS_KEY, VAA3D_USER_AWS_SECRET_KEY)
	job_items_list = []
	for item in job_items:
		if include_zip or not zipper.is_compressed_filename(item['input_filename']):
			item_dict = job_item_manager.convert_dynamo_job_item_to_dict(item)
			item_dict['job_item_status'] = JobItemStatus.query.get(int(item_dict['status_id'])).status_name
			output_s3_key = item_dict['output_dir'] + "/" + item_dict['output_filename']
			item_dict['download_url'] = s3.get_download_url(s3_conn, S3_OUTPUT_BUCKET, 
				output_s3_key, link_expiry_secs)
			logs_s3_key = item_dict['output_dir'] + "/logs/" + item_dict['output_filename'] + USER_JOB_LOG_EXT
			item_dict['logs_download_url'] = s3.get_download_url(s3_conn, S3_OUTPUT_BUCKET, 
				logs_s3_key, link_expiry_secs)
			job_items_list.append(item_dict)
	return job_items_list
Exemplo n.º 4
0
def get_job(job_id):
    job = Job.query.get(job_id)
    job_dict = job.as_dict()
    job_dict['job_status'] = job.job_status.status_name
    link_expiry_secs = 3600  # 1 hour
    s3_conn = s3.S3Connection(VAA3D_USER_AWS_ACCESS_KEY,
                              VAA3D_USER_AWS_SECRET_KEY)
    job_dict['download_url'] = s3.get_download_url(s3_conn, S3_OUTPUT_BUCKET,
                                                   job.get_output_s3_key(),
                                                   link_expiry_secs)
    return job_dict
Exemplo n.º 5
0
def get_job_items(job_id, include_zip=True):
    dynamo_conn = dynamo.get_connection()
    table = dynamo.get_table(dynamo_conn, DYNAMO_JOB_ITEMS_TABLE)
    job_items = dynamo.query_all(table, "job_index", "job_id", job_id)
    link_expiry_secs = 3600  # 1 hour
    s3_conn = s3.S3Connection(VAA3D_USER_AWS_ACCESS_KEY,
                              VAA3D_USER_AWS_SECRET_KEY)
    job_items_list = []
    for item in job_items:
        if include_zip or not zipper.is_compressed_filename(
                item['input_filename']):
            item_dict = job_item_manager.convert_dynamo_job_item_to_dict(item)
            item_dict['job_item_status'] = JobItemStatus.query.get(
                int(item_dict['status_id'])).status_name
            output_s3_key = item_dict['output_dir'] + "/" + item_dict[
                'output_filename']
            item_dict['download_url'] = s3.get_download_url(
                s3_conn, S3_OUTPUT_BUCKET, output_s3_key, link_expiry_secs)
            logs_s3_key = item_dict['output_dir'] + "/logs/" + item_dict[
                'output_filename'] + USER_JOB_LOG_EXT
            item_dict['logs_download_url'] = s3.get_download_url(
                s3_conn, S3_OUTPUT_BUCKET, logs_s3_key, link_expiry_secs)
            job_items_list.append(item_dict)
    return job_items_list
Exemplo n.º 6
0
def get_job_item_download_url(job_item_key):
	job_item = get_job_item_doc(job_item_key)
	s3_key = job_item['output_dir'] + "/" + job_item['output_filename']
	s3_conn = s3.S3Connection(VAA3D_USER_AWS_ACCESS_KEY, VAA3D_USER_AWS_SECRET_KEY)
	link_expiry_secs = 3600 # 1 hour
	return s3.get_download_url(s3_conn, S3_OUTPUT_BUCKET, s3_key, link_expiry_secs)