def upload_to_bucket()

in src/backend/main.py [0:0]


def upload_to_bucket(blob_name, the_file, bucket_name):
    """ Upload data to a bucket"""
    bucket = storage_client.get_bucket(bucket_name)
    blob = bucket.blob(blob_name)
    storage.blob._DEFAULT_CHUNKSIZE = 2097152 # 1024 * 1024 B * 2 = 2 MB
    storage.blob._MAX_MULTIPART_SIZE = 2097152 # 2 MB
    try:
        # content = the_file.read()
        blob.upload_from_filename(the_file)
        return f'gs://{BUCKET_NAME}/{blob_name}'
    except Exception as e:
        return f'FAILED to upload fasta file to GCS Bucket.\n{e}'