From ee21b54d315624c5a7d6e6d1b649c0b7202a4561 Mon Sep 17 00:00:00 2001 From: Erick Benitez-Ramos Date: Fri, 10 Jan 2025 12:31:04 -0800 Subject: [PATCH] fix: release workflows and fetch version dynamically in telemetry flow --- .github/workflows/botocore-sync.yml | 3 +++ .github/workflows/create-release.yml | 3 +++ .gitignore | 3 ++- src/sagemaker_core/main/user_agent.py | 2 +- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/botocore-sync.yml b/.github/workflows/botocore-sync.yml index b54fce5e..99eea5ce 100644 --- a/.github/workflows/botocore-sync.yml +++ b/.github/workflows/botocore-sync.yml @@ -5,6 +5,9 @@ on: # Every Monday to Friday at 10:00 UTC (3:00 PDT) - cron: 00 10 * * 1-5 +permissions: + id-token: write # This is required for requesting the JWT + jobs: sync-with-botocore: runs-on: ubuntu-latest diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 5b47857d..13383705 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -6,6 +6,9 @@ on: branches: - main +permissions: + id-token: write # This is required for requesting the JWT + jobs: create-release: if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Daily Sync with Botocore') && github.event.pull_request.user.login == 'sagemaker-bot' diff --git a/.gitignore b/.gitignore index 2b525148..eba6c8f0 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ build/ dist/ *.egg-info/ *_build/ -*html/ \ No newline at end of file +*html/ +data/ \ No newline at end of file diff --git a/src/sagemaker_core/main/user_agent.py b/src/sagemaker_core/main/user_agent.py index 5b4bebdb..4b5ee2cf 100644 --- a/src/sagemaker_core/main/user_agent.py +++ b/src/sagemaker_core/main/user_agent.py @@ -24,7 +24,7 @@ NOTEBOOK_METADATA_FILE = "/etc/opt/ml/sagemaker-notebook-instance-version.txt" STUDIO_METADATA_FILE = "/opt/ml/metadata/resource-metadata.json" -SagemakerCore_VERSION = "v0.1.6" +SagemakerCore_VERSION = importlib_metadata.version("sagemaker-core") def process_notebook_metadata_file() -> str: