From a4ae132ef403843d01ba548e5a9cb896adca0fb4 Mon Sep 17 00:00:00 2001 From: Guancheng Fu <110874468+gc-fu@users.noreply.github.com> Date: Mon, 10 Jul 2023 10:10:38 +0800 Subject: [PATCH] Add bigdl llm sgx image (#8480) * Add dockerfile for bigdl-llm-ppml * fix llm-cli multi-process * add workflow --- .github/workflows/manually_build.yml | 63 +++++++++++++++++ .../workflows/manually_build_for_testing.yml | 67 +++++++++++++++++++ 2 files changed, 130 insertions(+) diff --git a/.github/workflows/manually_build.yml b/.github/workflows/manually_build.yml index 3e2f2485..8267bf79 100644 --- a/.github/workflows/manually_build.yml +++ b/.github/workflows/manually_build.yml @@ -13,6 +13,8 @@ on: - bigdl-ppml-gramine-base - bigdl-ppml-trusted-deep-learning-gramine-base - bigdl-ppml-trusted-deep-learning-gramine-ref + - bigdl-ppml-trusted-bigdl-llm-gramine-base + - bigdl-ppml-trusted-bigdl-llm-gramine-ref - bigdl-ppml-trusted-dl-serving-gramine-base - bigdl-ppml-trusted-dl-serving-gramine-ref - bigdl-ppml-trusted-big-data-ml-python-gramine @@ -78,6 +80,67 @@ jobs: sudo docker tag ${base_image}:${TAG} 10.239.45.10/arda/${base_image}:${TAG} sudo docker push 10.239.45.10/arda/${base_image}:${TAG} + bigdl-ppml-trusted-bigdl-llm-gramine-base: + if: ${{ github.event.inputs.artifact == 'bigdl-ppml-trusted-bigdl-llm-gramine-base' || github.event.inputs.artifact == 'all' }} + runs-on: [self-hosted, Shire] + steps: + - uses: actions/checkout@v3 + - name: docker login + run: | + docker login -u ${DOCKERHUB_USERNAME} -p ${DOCKERHUB_PASSWORD} + - name: bigdl-ppml-trusted-bigdl-llm-gramine-base + run: | + echo "##############################################################" + echo "####### bigdl-ppml-trusted-bigdl-llm-gramine-base ########" + echo "##############################################################" + export base_image=intelanalytics/bigdl-ppml-gramine-base + docker pull ${base_image}:${TAG} + export image=intelanalytics/bigdl-ppml-trusted-bigdl-llm-gramine-base + cd ppml/trusted-bigdl-llm/base + sudo docker build \ + --no-cache=true \ + --build-arg http_proxy=${HTTP_PROXY} \ + --build-arg https_proxy=${HTTPS_PROXY} \ + --build-arg no_proxy=${NO_PROXY} \ + --build-arg BASE_IMAGE_NAME=${base_image} \ + --build-arg BASE_IMAGE_TAG=${TAG} \ + -t ${image}:${TAG} -f ./Dockerfile . + sudo docker push ${image}:${TAG} + sudo docker tag ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + sudo docker push 10.239.45.10/arda/${image}:${TAG} + sudo docker rmi -f ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + + bigdl-ppml-trusted-bigdl-llm-gramine-ref: + if: ${{ github.event.inputs.artifact == 'bigdl-ppml-trusted-bigdl-llm-gramine-ref' || github.event.inputs.artifact == 'all' }} + runs-on: [self-hosted, Shire] + steps: + - uses: actions/checkout@v3 + - name: docker login + run: | + docker login -u ${DOCKERHUB_USERNAME} -p ${DOCKERHUB_PASSWORD} + - name: bigdl-ppml-trusted-bigdl-llm-gramine-ref + run: | + echo "##############################################################" + echo "####### bigdl-ppml-trusted-bigdl-llm-gramine-ref ########" + echo "##############################################################" + export base_image=intelanalytics/bigdl-ppml-trusted-bigdl-llm-gramine-base + docker pull ${base_image}:${TAG} + export image=intelanalytics/bigdl-ppml-trusted-bigdl-llm-gramine-ref + cd ppml/trusted-bigdl-llm/ref + openssl genrsa -3 -out enclave-key.pem 3072 + sudo docker build \ + --no-cache=true \ + --build-arg http_proxy=${HTTP_PROXY} \ + --build-arg https_proxy=${HTTPS_PROXY} \ + --build-arg no_proxy=${NO_PROXY} \ + --build-arg BASE_IMAGE_NAME=${base_image} \ + --build-arg BASE_IMAGE_TAG=${TAG} \ + -t ${image}:${TAG} -f ./Dockerfile . + sudo docker push ${image}:${TAG} + sudo docker tag ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + sudo docker push 10.239.45.10/arda/${image}:${TAG} + sudo docker rmi -f ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + bigdl-ppml-trusted-deep-learning-gramine-base: if: ${{ github.event.inputs.artifact == 'bigdl-ppml-trusted-deep-learning-gramine-base' || github.event.inputs.artifact == 'all' }} runs-on: [self-hosted, Shire] diff --git a/.github/workflows/manually_build_for_testing.yml b/.github/workflows/manually_build_for_testing.yml index bae4a3e6..57365c3e 100644 --- a/.github/workflows/manually_build_for_testing.yml +++ b/.github/workflows/manually_build_for_testing.yml @@ -15,6 +15,8 @@ on: options: - all - bigdl-ppml-gramine-base + - bigdl-ppml-trusted-bigdl-llm-gramine-base + - bigdl-ppml-trusted-bigdl-llm-gramine-ref - bigdl-ppml-trusted-deep-learning-gramine-base - bigdl-ppml-trusted-deep-learning-gramine-ref - bigdl-ppml-trusted-dl-serving-gramine-base @@ -77,6 +79,71 @@ jobs: sudo docker push 10.239.45.10/arda/${base_image}:${TAG} sudo docker rmi -f ${base_image}:${TAG} 10.239.45.10/arda/${base_image}:${TAG} + bigdl-ppml-trusted-bigdl-llm-gramine-base: + if: ${{ github.event.inputs.artifact == 'bigdl-ppml-trusted-bigdl-llm-gramine-base' || github.event.inputs.artifact == 'all' }} + runs-on: [self-hosted, Shire] + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.sha }} + - name: docker login + run: | + docker login -u ${DOCKERHUB_USERNAME} -p ${DOCKERHUB_PASSWORD} + - name: bigdl-ppml-trusted-bigdl-llm-gramine-base + run: | + echo "##############################################################" + echo "####### bigdl-ppml-trusted-bigdl-llm-gramine-base ########" + echo "##############################################################" + export base_image=intelanalytics/bigdl-ppml-gramine-base + docker pull ${base_image}:${TAG} + export image=intelanalytics/bigdl-ppml-trusted-bigdl-llm-gramine-base + cd ppml/trusted-bigdl-llm/base + sudo docker build \ + --no-cache=true \ + --build-arg http_proxy=${HTTP_PROXY} \ + --build-arg https_proxy=${HTTPS_PROXY} \ + --build-arg no_proxy=${NO_PROXY} \ + --build-arg BASE_IMAGE_NAME=${base_image} \ + --build-arg BASE_IMAGE_TAG=${TAG} \ + -t ${image}:${TAG} -f ./Dockerfile . + sudo docker push ${image}:${TAG} + sudo docker tag ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + sudo docker push 10.239.45.10/arda/${image}:${TAG} + sudo docker rmi -f ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + + bigdl-ppml-trusted-bigdl-llm-gramine-ref: + if: ${{ github.event.inputs.artifact == 'bigdl-ppml-trusted-bigdl-llm-gramine-ref' || github.event.inputs.artifact == 'all' }} + runs-on: [self-hosted, Shire] + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.sha }} + - name: docker login + run: | + docker login -u ${DOCKERHUB_USERNAME} -p ${DOCKERHUB_PASSWORD} + - name: bigdl-ppml-trusted-bigdl-llm-gramine-ref + run: | + echo "##############################################################" + echo "####### bigdl-ppml-trusted-bigdl-llm-gramine-ref ########" + echo "##############################################################" + export base_image=intelanalytics/bigdl-ppml-trusted-bigdl-llm-gramine-base + docker pull ${base_image}:${TAG} + export image=intelanalytics/bigdl-ppml-trusted-bigdl-llm-gramine-ref + cd ppml/trusted-bigdl-llm/ref + openssl genrsa -3 -out enclave-key.pem 3072 + sudo docker build \ + --no-cache=true \ + --build-arg http_proxy=${HTTP_PROXY} \ + --build-arg https_proxy=${HTTPS_PROXY} \ + --build-arg no_proxy=${NO_PROXY} \ + --build-arg BASE_IMAGE_NAME=${base_image} \ + --build-arg BASE_IMAGE_TAG=${TAG} \ + -t ${image}:${TAG} -f ./Dockerfile . + sudo docker push ${image}:${TAG} + sudo docker tag ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + sudo docker push 10.239.45.10/arda/${image}:${TAG} + sudo docker rmi -f ${image}:${TAG} 10.239.45.10/arda/${image}:${TAG} + bigdl-ppml-trusted-dl-serving-gramine-base: if: ${{ github.event.inputs.artifact == 'bigdl-ppml-trusted-dl-serving-gramine-base' || github.event.inputs.artifact == 'all' }} runs-on: [self-hosted, Shire]