Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions phala-cloud-prelaunch-script/prelaunch.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
echo "----------------------------------------------"
echo "Running Phala Cloud Pre-Launch Script v0.0.20"
echo "Running Phala Cloud Pre-Launch Script v0.0.21"
echo "----------------------------------------------"
set -e

Expand Down Expand Up @@ -95,6 +95,12 @@ echo "Starting login process..."
# credentials set. Bare "$VAR" throws "unbound variable" under nounset.
DOCKER_REGISTRY_TARGET="${DSTACK_DOCKER_REGISTRY:-docker.io}"

# dstack-0.6.1 Debian rootfs is read-only. docker login would create
# $HOME/.docker (/root/.docker), which is not in the writable overlay.
export DOCKER_CONFIG=/tmp/.docker
mkdir -p "$DOCKER_CONFIG"
chmod 700 "$DOCKER_CONFIG"

# Check if Docker credentials exist
if [[ -n "${DSTACK_DOCKER_USERNAME-}" && -n "${DSTACK_DOCKER_PASSWORD-}" ]]; then
echo "Docker credentials found"
Expand Down Expand Up @@ -137,7 +143,15 @@ elif [[ -n "${DSTACK_AWS_ACCESS_KEY_ID-}" && -n "${DSTACK_AWS_SECRET_ACCESS_KEY-
notify_host_hoot_error "awscli install failed"
exit 1
fi
unzip awscliv2.zip &> /dev/null
if command -v unzip >/dev/null 2>&1; then
unzip awscliv2.zip >/dev/null 2>&1
elif command -v busybox >/dev/null 2>&1; then
busybox unzip awscliv2.zip >/dev/null 2>&1
else
echo "ERROR: unzip is not available"
notify_host_hoot_error "awscli install failed"
exit 1
fi
else
echo "AWS CLI is already installed: ./aws/dist/aws"
fi
Expand Down
Loading