Skip to content

Commit c67915d

Browse files
chore: Generate build artifacts for 2.8.5 release
1 parent 245b419 commit c67915d

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Download Amazon Q artifacts for IDE integration
5+
# Usage: download_amazon_q_artifacts.sh <version> <target_dir> <ide_type>
6+
# Example: download_amazon_q_artifacts.sh 1.25.0 /etc/amazon-q/artifacts/agentic-chat jupyterlab
7+
8+
VERSION=${1:-$FLARE_SERVER_VERSION_JL}
9+
TARGET_DIR=${2:-"/etc/amazon-q-agentic-chat/artifacts/jupyterlab"}
10+
IDE_TYPE=${3:-"jupyterlab"}
11+
12+
if [ -z "$VERSION" ]; then
13+
echo "Error: Version not specified and FLARE_SERVER_VERSION_JL not set"
14+
exit 1
15+
fi
16+
17+
echo "Downloading Amazon Q artifacts for $IDE_TYPE (version: $VERSION)"
18+
19+
# Create target directories
20+
sudo mkdir -p "$TARGET_DIR"
21+
22+
# Download manifest and extract artifact URLs
23+
MANIFEST_URL="https://aws-toolkit-language-servers.amazonaws.com/qAgenticChatServer/0/manifest.json"
24+
curl -L --retry 3 --retry-delay 5 --fail "$MANIFEST_URL" -o "/tmp/manifest.json" || {
25+
echo "Failed to download manifest"
26+
exit 1
27+
}
28+
29+
# Extract artifact URLs
30+
ARTIFACT_URLS=$(python3 /tmp/extract_amazon_q_agentic_chat_urls.py /tmp/manifest.json "$VERSION")
31+
if [ $? -ne 0 ] || [ -z "$ARTIFACT_URLS" ]; then
32+
echo "Failed to extract Amazon Q artifact URLs"
33+
exit 1
34+
fi
35+
36+
eval "$ARTIFACT_URLS"
37+
38+
# Download and extract servers.zip
39+
echo "Downloading servers.zip..."
40+
curl -L --retry 3 --retry-delay 5 --fail "$SERVERS_URL" -o "/tmp/servers.zip" || {
41+
echo "Failed to download servers.zip"
42+
exit 1
43+
}
44+
sudo unzip "/tmp/servers.zip" -d "$TARGET_DIR/servers" || {
45+
echo "Failed to extract servers.zip"
46+
exit 1
47+
}
48+
49+
# Download and extract clients.zip
50+
echo "Downloading clients.zip..."
51+
curl -L --retry 3 --retry-delay 5 --fail "$CLIENTS_URL" -o "/tmp/clients.zip" || {
52+
echo "Failed to download clients.zip"
53+
exit 1
54+
}
55+
sudo unzip "/tmp/clients.zip" -d "$TARGET_DIR/clients" || {
56+
echo "Failed to extract clients.zip"
57+
exit 1
58+
}
59+
60+
# Clean up temporary files
61+
rm -f /tmp/manifest.json /tmp/servers.zip /tmp/clients.zip
62+
63+
echo "Amazon Q artifacts downloaded successfully to $TARGET_DIR"
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env python3
2+
"""Extract Amazon Q artifact URLs from manifest for Linux x64 platform."""
3+
4+
import json
5+
import sys
6+
7+
8+
def extract_urls(manifest_file, version, platform="linux", arch="x64"):
9+
"""Extract servers.zip and clients.zip URLs for specified platform/arch."""
10+
try:
11+
with open(manifest_file) as f:
12+
manifest = json.load(f)
13+
except FileNotFoundError:
14+
raise FileNotFoundError(f"Manifest file not found: {manifest_file}")
15+
except json.JSONDecodeError as e:
16+
raise ValueError(f"Invalid JSON in manifest file {manifest_file}: {str(e)}")
17+
18+
for ver in manifest["versions"]:
19+
if ver["serverVersion"] == version:
20+
for target in ver["targets"]:
21+
if target["platform"] == platform and target.get("arch") == arch:
22+
servers_url = None
23+
clients_url = None
24+
25+
for content in target["contents"]:
26+
if content["filename"] == "servers.zip":
27+
servers_url = content["url"]
28+
elif content["filename"] == "clients.zip":
29+
clients_url = content["url"]
30+
31+
if servers_url is None or clients_url is None:
32+
raise ValueError(
33+
f"Required files (servers.zip/clients.zip) not found for version {version} {platform} {arch}"
34+
)
35+
36+
return servers_url, clients_url
37+
38+
raise ValueError(f"Version {version} not found for {platform} {arch}")
39+
40+
41+
if __name__ == "__main__":
42+
if len(sys.argv) != 3:
43+
print("Usage: extract_amazon_q_agentic_chat_urls.py <manifest_file> <version>")
44+
sys.exit(1)
45+
46+
manifest_file, version = sys.argv[1], sys.argv[2]
47+
servers_url, clients_url = extract_urls(manifest_file, version)
48+
49+
print(f"SERVERS_URL={servers_url}")
50+
print(f"CLIENTS_URL={clients_url}")

0 commit comments

Comments
 (0)