Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/gha/gcs_uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def main(argv):
for artifact in artifacts:
dest = _local_path_to_gcs_uri(gcs_prefix, artifact, testapp_dir)
logging.info("Creating %s", dest)
subprocess.run([gcs.GSUTIL, "cp", artifact, dest], check=True)
subprocess.run(["gcloud", "storage", "cp", artifact, dest], check=True)
logging.info("Finished uploading to %s", gcs_prefix)
logging.info(
"Use 'gsutil cp <gs_uri> <local_path>' to copy an artifact locally.\n"
"Use 'gsutil -m cp -r %s <local_path>' to copy everything.", gcs_prefix)
"Use 'gcloud storage cp <gs_uri> <local_path>' to copy an artifact locally.\n"
"Use 'gcloud storage cp --recursive %s <local_path>' to copy everything.", gcs_prefix)


def _local_path_to_gcs_uri(gcs_prefix, path, testapp_dir):
Expand Down
6 changes: 3 additions & 3 deletions scripts/gha/integration_testing/ftl_gha_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import re
from retry import retry

GSUTIL = shutil.which("gsutil")
GSUTIL = shutil.which("gcloud")
Comment thread
gurusai-voleti marked this conversation as resolved.
Outdated

def validate(test_summary):
if not test_summary:
Expand Down Expand Up @@ -77,7 +77,7 @@ def _get_testapp_log_text_from_gcs(gcs_path):
@retry(subprocess.CalledProcessError, tries=10, delay=5, backoff=1.5)
def _gcs_list_dir(gcs_path):
"""Recursively returns a list of contents for a directory on GCS."""
args = [GSUTIL, "ls", "-r", gcs_path]
args = [GSUTIL, "storage", "ls", "--recursive", gcs_path]
logging.info("Listing GCS contents: %s", " ".join(args))
try:
result = subprocess.run(args=args, capture_output=True, text=True, check=True)
Expand All @@ -97,7 +97,7 @@ def _gcs_list_dir(gcs_path):
@retry(subprocess.CalledProcessError, tries=10, delay=5, backoff=1.5)
def _gcs_read_file(gcs_path):
"""Extracts the contents of a file on GCS."""
args = [GSUTIL, "cat", gcs_path]
args = [GSUTIL, "storage", "cat", gcs_path]
logging.info("Reading GCS file: %s", " ".join(args))
try:
result = subprocess.run(args=args, capture_output=True, text=True, check=True)
Expand Down
12 changes: 6 additions & 6 deletions scripts/gha/integration_testing/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_unique_gcs_id():


def relative_path_to_gs_uri(path):
"""Converts a relative GCS path to a GS URI understood by gsutil.
"""Converts a relative GCS path to a GS URI understood by gcloud storage.

This will prepend the gs prefix and project id to the path, i.e.
path -> gs://<project_id>/results_dir
Expand Down Expand Up @@ -93,10 +93,10 @@ def authorize_gcs(key_file):
def get_gsutil_tips():
"""Returns a human readable string with tips on accessing a GCS bucket."""
return "\n".join((
"GCS Advice: Install the Google Cloud SDK to access the gsutil tool.",
"Use 'gsutil ls <gs_uri>' to list contents of a directory on GCS.",
"Use 'gsutil cp <gs_uri> <local_path>' to copy an artifact.",
"Use 'gsutil -m cp -r <gs_uri> <local_path>' to copy a directory."
"GCS Advice: Install the Google Cloud SDK to access the gcloud storage tool.",
"Use 'gcloud storage ls <gs_uri>' to list contents of a directory on GCS.",
"Use 'gcloud storage cp <gs_uri> <local_path>' to copy an artifact.",
"Use 'gcloud storage cp --recursive <gs_uri> <local_path>' to copy a directory."
Comment thread
gurusai-voleti marked this conversation as resolved.
))


Expand All @@ -110,4 +110,4 @@ def _verify_gcloud_sdk_command_line_tools():
if not GCLOUD or not GSUTIL:
raise RuntimeError("Could not find required gCloud SDK tool(s)")
subprocess.run([GCLOUD, "version"], check=True)
subprocess.run([GSUTIL, "version"], check=True)
subprocess.run([GCLOUD, "-v"], check=True)
Comment thread
gurusai-voleti marked this conversation as resolved.
Outdated