Skip to content

Commit 602f714

Browse files
committed
ci: remove insecure option for downloading LiteCore
Signed-off-by: jiseong.oh <[email protected]>
1 parent ac315c2 commit 602f714

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

.ci/scripts/setup-samsung-linux-deps.sh

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,40 @@ set -ex
1010

1111

1212
download_ai_lite_core() {
13-
AI_LITE_CORE_VERSION=$1
14-
_exynos_ai_lite_core_url="https://ko.ai-studio-farm.com:26310/api/v1/buckets/lite-core/objects/download?prefix=05/ubuntu2204/exynos-ai-litecore-v0.5.0,tar.gz"
13+
API_BASE="https://soc-developer.semiconductor.samsung.com/api/v1/resource/ai-litecore/download"
14+
API_KEY="kn10SoSY3hkC-9Qny5TqD2mnqVrlupv3krnjLeBt5cY"
1515

16-
_exynos_lite_core_dir=/tmp/exynos_ai_lite_core
17-
mkdir -p ${_exynos_lite_core_dir}
16+
VERSION="0.5"
17+
OS_NAME="Ubuntu 22.04"
18+
OUT_FILE="/tmp/exynos-ai-litecore-v${VERSION}.tar.gz"
19+
TARGET_PATH="/tmp/exynos_ai_lite_core"
1820

19-
_tmp_archive="/tmp/exynos-ai-litecore-v0.5.0.tar.gz"
21+
mkdir -p ${TARGET_PATH}
22+
# Presigned issue URL
23+
JSON_RESP=$(curl -sS -G \
24+
--location --fail --retry 3 \
25+
-H "apikey: ${API_KEY}" \
26+
--data-urlencode "version=${VERSION}" \
27+
--data-urlencode "os=${OS_NAME}" \
28+
"${API_BASE}")
2029

21-
sudo update-ca-certificates
30+
DOWNLOAD_URL=$(echo "$JSON_RESP" | sed -n 's/.*"data":[[:space:]]*"\([^"]*\)".*/\1/p')
2231

23-
curl --silent --show-error --location --fail --retry 3 \
24-
--output "${_tmp_archive}" --insecure "${_exynos_ai_lite_core_url}"
32+
if [[ -z "$DOWNLOAD_URL" ]]; then
33+
echo "Failed to extract download URL"
34+
echo "$JSON_RESP"
35+
exit 1
36+
fi
2537

26-
tar -C "${_exynos_lite_core_dir}" --strip-components=1 -xzvf "${_tmp_archive}"
38+
# Download LiteCore
39+
curl -sS -L --fail --retry 3 \
40+
--output "$OUT_FILE" \
41+
"$DOWNLOAD_URL"
42+
43+
echo "Download done: $OUT_FILE"
44+
45+
46+
tar -C "${TARGET_PATH}" --strip-components=1 -xzvf "${OUT_FILE}"
2747

2848
export EXYNOS_AI_LITECORE_ROOT=${_exynos_lite_core_dir}
2949
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${EXYNOS_AI_LITECORE_ROOT}/lib/x86_64-linux

0 commit comments

Comments
 (0)