Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Fix dev-box #3388

Merged
merged 2 commits into from Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Jenkinsfile
Expand Up @@ -118,7 +118,7 @@ sudo docker run -itd \
--privileged=true \
--net=host \
--name=dev-box-singlebox \
10.0.1.5:5000/openpai/dev-box:${IMAGE_TAG} /bin/bash > SINGLE_BOX_DEV_BOX.txt
10.0.1.5:5000/openpai/dev-box:${IMAGE_TAG} nofetch > SINGLE_BOX_DEV_BOX.txt

sudo docker exec $(cat SINGLE_BOX_DEV_BOX.txt) rm -rf /pai
sudo docker cp ${WORKSPACE} $(cat SINGLE_BOX_DEV_BOX.txt):/pai
Expand Down Expand Up @@ -208,7 +208,7 @@ sudo docker run -itd \
--privileged=true \
--net=host \
--name=dev-box-cluster \
10.0.1.5:5000/openpai/dev-box:${IMAGE_TAG} /bin/bash > CLUSTER_DEV_BOX.txt
10.0.1.5:5000/openpai/dev-box:${IMAGE_TAG} nofetch > CLUSTER_DEV_BOX.txt

sudo docker exec $(cat CLUSTER_DEV_BOX.txt) rm -rf /pai
sudo docker cp ${WORKSPACE} $(cat CLUSTER_DEV_BOX.txt):/pai
Expand Down
3 changes: 1 addition & 2 deletions src/dev-box/build/dev-box.dockerfile
Expand Up @@ -125,5 +125,4 @@ WORKDIR /
COPY build/start-script.sh /usr/local
RUN chmod u+x /usr/local/start-script.sh

CMD ["/usr/local/start-script.sh"]

ENTRYPOINT ["/usr/local/start-script.sh"]
12 changes: 9 additions & 3 deletions src/dev-box/build/start-script.sh
Expand Up @@ -19,9 +19,15 @@

pushd $(dirname "$0") > /dev/null

cd /pai
git fetch --tags
TAG=$(curl --silent "https://api.github.com/repos/microsoft/pai/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') && git checkout $TAG
if [[ $# -eq 0 ]]; then
echo "Fetch latest release code"
cd /pai
git fetch --tags
TAG=$(curl --silent "https://api.github.com/repos/microsoft/pai/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') && git checkout $TAG
else
echo "Skip fetching latest release code"
fi

/bin/bash

popd > /dev/null