def upload_artefacts()

in text-semantic-search/index_builder/builder/task.py [0:0]


def upload_artefacts(gcs_index_file):

  http = Http()
  credentials = GoogleCredentials.get_application_default()
  credentials.authorize(http)
  gcs_services = build('storage', 'v1', http=http)

  split_list = gcs_index_file[5:].split('/', 1)
  bucket_name = split_list[0]
  blob_path = split_list[1] if len(split_list) == 2 else None
  _upload_to_gcs(gcs_services, LOCAL_INDEX_FILE, bucket_name, blob_path)
  _upload_to_gcs(gcs_services,
                 LOCAL_INDEX_FILE+'.mapping', bucket_name, blob_path+'.mapping')