From a9334c734ab5dd43758c0368d0810e1417e8e6c6 Mon Sep 17 00:00:00 2001 From: Chava Barboza Date: Tue, 6 May 2025 16:52:14 +0000 Subject: [PATCH 1/4] Update devcon --- .devcontainer/onCreate.sh | 49 +++++++++++++-------------------------- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/.devcontainer/onCreate.sh b/.devcontainer/onCreate.sh index 2cbd6e5..d871bbb 100755 --- a/.devcontainer/onCreate.sh +++ b/.devcontainer/onCreate.sh @@ -12,34 +12,19 @@ echo "Installing the GitHub CLI" && sudo apt update \ && sudo apt install gh inotify-tools -y -echo "Installing the GitHub CLI Runtime extension" -# if the GITHUB_USER is monalisa, then install the plugin from the local folder -if [ "$GITHUB_USER" = "monalisa" ]; then - cd ./gh-runtime-cli - gh extension install . -else - gh extension install github/gh-runtime-cli -fi - -echo "Adding an alias for the GitHub CLI Runtime extension" -gh alias set runtime runtime-cli - -echo "Downloading the latest release of workbench-template from GitHub" +echo "Installing azcopy" -GITHUB_PAT="$RELEASE_PAT" -REPO="github/workbench-template" +sudo wget -O /usr/local/bin/azcopytar https://aka.ms/downloadazcopy-v10-linux +sudo tar -xvf /usr/local/bin/azcopytar -C /usr/local/bin/ +sudo rm /usr/local/bin/azcopytar +azcopy_dir=$(find /usr/local/bin/ -type d -name "azcopy*" | head -n 1) +sudo mv "$azcopy_dir/azcopy" /usr/local/bin/azcopy +sudo rm -rf "$azcopy_dir" -# Fetch the latest release information -LATEST_RELEASE=$(curl -s -H "Authorization: token $GITHUB_PAT" https://api.github.com/repos/$REPO/releases/latest) -# Extract the first browser_download_url from the assets +LATEST_RELEASE=$(curl -s -H "Authorization: token $TEMPLATE_PAT" https://api.github.com/repos/github/spark-template/releases/216808806) DOWNLOAD_URL=$(echo "$LATEST_RELEASE" | jq -r '.assets[0].url') -echo "Download URL: $DOWNLOAD_URL" - - -# Fetch the latest release information -curl -L -o dist.zip -H "Authorization: token $GITHUB_PAT" -H "Accept: application/octet-stream" "$DOWNLOAD_URL" - +curl -L -o dist.zip -H "Authorization: token $TEMPLATE_PAT" -H "Accept: application/octet-stream" "$DOWNLOAD_URL" unzip -o dist.zip rm dist.zip @@ -56,7 +41,13 @@ tar -xzf ./spark-sdk-dist/spark-tools.tgz mkdir -p /workspaces/spark-tools sudo mv ./package/* /workspaces/spark-tools sudo rmdir ./package -rm -rf ./spark-sdk-dist + +sudo mv spark-sdk-dist/gh-spark-cli /usr/local/bin/ +cd /usr/local/bin/gh-spark-cli +gh extension install . +gh alias set spark spark-cli + +rm -rf /workspaces/spark-template/spark-sdk-dist cd /workspaces/spark-tools npm i @@ -65,11 +56,3 @@ npm i -f /workspaces/spark-tools -echo "Installing azcopy" - -sudo wget -O /usr/local/bin/azcopytar https://aka.ms/downloadazcopy-v10-linux -sudo tar -xvf /usr/local/bin/azcopytar -C /usr/local/bin/ -sudo rm /usr/local/bin/azcopytar -azcopy_dir=$(find /usr/local/bin/ -type d -name "azcopy*" | head -n 1) -sudo mv "$azcopy_dir/azcopy" /usr/local/bin/azcopy -sudo rm -rf "$azcopy_dir" From a9f8e6a588cddf67a5190899b004bb501f190a37 Mon Sep 17 00:00:00 2001 From: Chava Barboza Date: Tue, 6 May 2025 16:57:47 +0000 Subject: [PATCH 2/4] Remove dependency --- .devcontainer/devcontainer.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5c25d67..587515b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -23,18 +23,6 @@ "ghcr.io/devcontainers/features/sshd:1": { "version": "latest" } - }, - "customizations": { - "codespaces": { - "repositories": { - "github/gh-runtime-cli": { - "permissions": { - "contents": "read", - "packages": "read" - } - } - } - } } } \ No newline at end of file From 42858a512ac8bedb7afb3a8e3e49f1755cfc84ed Mon Sep 17 00:00:00 2001 From: Chava Barboza Date: Tue, 6 May 2025 19:38:03 +0000 Subject: [PATCH 3/4] Update --- deploy.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/deploy.sh b/deploy.sh index fba43ea..8907263 100755 --- a/deploy.sh +++ b/deploy.sh @@ -38,16 +38,16 @@ fi echo "Deploying as ${GITHUB_USER} to ${GITHUB_RUNTIME_PERMANENT_NAME}" -gh runtime create \ +gh spark create \ --app ${GITHUB_RUNTIME_PERMANENT_NAME} \ --env "GITHUB_RUNTIME_PERMANENT_NAME=${GITHUB_RUNTIME_PERMANENT_NAME}" \ --secret "GITHUB_TOKEN=${GITHUB_TOKEN}" \ -gh runtime deploy \ +gh spark deploy \ --app ${GITHUB_RUNTIME_PERMANENT_NAME} \ --dir dist -DEPLOYED_URL="$(gh runtime get --app ${GITHUB_RUNTIME_PERMANENT_NAME})" +DEPLOYED_URL="$(gh spark get --app ${GITHUB_RUNTIME_PERMANENT_NAME})" echo "[--URL-App=[https://${DEPLOYED_URL}]--]" echo "[--Deployment: Complete--]" From 24cd1f397efe7df0e267d13525845d006a65e348 Mon Sep 17 00:00:00 2001 From: Chava Barboza Date: Tue, 6 May 2025 16:02:01 -0400 Subject: [PATCH 4/4] Update onCreate.sh --- .devcontainer/onCreate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/onCreate.sh b/.devcontainer/onCreate.sh index d871bbb..8c357e2 100755 --- a/.devcontainer/onCreate.sh +++ b/.devcontainer/onCreate.sh @@ -22,7 +22,7 @@ sudo mv "$azcopy_dir/azcopy" /usr/local/bin/azcopy sudo rm -rf "$azcopy_dir" -LATEST_RELEASE=$(curl -s -H "Authorization: token $TEMPLATE_PAT" https://api.github.com/repos/github/spark-template/releases/216808806) +LATEST_RELEASE=$(curl -s -H "Authorization: token $TEMPLATE_PAT" https://api.github.com/repos/github/spark-template/releases/latest) DOWNLOAD_URL=$(echo "$LATEST_RELEASE" | jq -r '.assets[0].url') curl -L -o dist.zip -H "Authorization: token $TEMPLATE_PAT" -H "Accept: application/octet-stream" "$DOWNLOAD_URL" unzip -o dist.zip