|
|
@@ -23,48 +23,6 @@ function download_deps() {
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
-function download_ui() {
|
|
|
- local default_tag="latest"
|
|
|
- local ui_path="${ROOT_DIR}/gpustack/ui"
|
|
|
- local tmp_ui_path="${ui_path}/tmp"
|
|
|
- local tag="latest"
|
|
|
-
|
|
|
- if [[ "${GIT_VERSION}" != "v0.0.0" ]]; then
|
|
|
- tag="${GIT_VERSION}"
|
|
|
- fi
|
|
|
-
|
|
|
- rm -rf "${ui_path}"
|
|
|
- mkdir -p "${tmp_ui_path}/ui"
|
|
|
-
|
|
|
- gpustack::log::info "downloading '${tag}' UI assets"
|
|
|
-
|
|
|
- if ! curl --retry 3 --retry-connrefused --retry-delay 3 -sSfL "https://gpustack-ui-1303613262.cos.accelerate.myqcloud.com/releases/${tag}.tar.gz" 2>/dev/null |
|
|
|
- tar -xzf - --directory "${tmp_ui_path}/ui" 2>/dev/null; then
|
|
|
-
|
|
|
- if [[ "${tag:-}" =~ ^v([0-9]+)\.([0-9]+)(\.[0-9]+)?(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$ ]]; then
|
|
|
- gpustack::log::fatal "failed to download '${tag}' ui archive"
|
|
|
- fi
|
|
|
-
|
|
|
- gpustack::log::warn "failed to download '${tag}' ui archive, fallback to '${default_tag}' ui archive"
|
|
|
- if ! curl --retry 3 --retry-connrefused --retry-delay 3 -sSfL "https://gpustack-ui-1303613262.cos.accelerate.myqcloud.com/releases/${default_tag}.tar.gz" |
|
|
|
- tar -xzf - --directory "${tmp_ui_path}/ui" 2>/dev/null; then
|
|
|
- gpustack::log::fatal "failed to download '${default_tag}' ui archive"
|
|
|
- fi
|
|
|
- fi
|
|
|
- cp -a "${tmp_ui_path}/ui/dist/." "${ui_path}"
|
|
|
-
|
|
|
- rm -rf "${tmp_ui_path}"
|
|
|
-}
|
|
|
-
|
|
|
-# Copy extra static files to ui including catalog icons
|
|
|
-function copy_extra_static() {
|
|
|
- local extra_static_path="${ROOT_DIR}/static"
|
|
|
- local ui_static_path="${ROOT_DIR}/gpustack/ui/static"
|
|
|
- if [ -d "${extra_static_path}" ]; then
|
|
|
- cp -a "${extra_static_path}/." "${ui_static_path}"
|
|
|
- fi
|
|
|
-}
|
|
|
-
|
|
|
# Update community backends
|
|
|
function make_community_backends() {
|
|
|
local tmp_dir
|
|
|
@@ -105,7 +63,5 @@ function make_community_backends() {
|
|
|
|
|
|
gpustack::log::info "+++ DEPENDENCIES +++"
|
|
|
download_deps
|
|
|
-download_ui
|
|
|
-copy_extra_static
|
|
|
make_community_backends
|
|
|
gpustack::log::info "--- DEPENDENCIES ---"
|