From 7ba0fd113a6f6ab953b84ced1b67288de4846d8c Mon Sep 17 00:00:00 2001 From: Katherine Chen Date: Tue, 16 Jul 2024 15:09:36 +1000 Subject: [PATCH] Add config server changes --- .../actions/build_eks_docker_image/action.yaml | 1 + .../publish-aws-eks-nitro-enclave-docker.yaml | 4 ++-- config-server/__pycache__/app.cpython-310.pyc | Bin 0 -> 478 bytes scripts/aws/eks/pod/Dockerfile | 8 ++++++++ scripts/aws/eks/pod/entrypoint.sh | 5 +++++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 config-server/__pycache__/app.cpython-310.pyc diff --git a/.github/actions/build_eks_docker_image/action.yaml b/.github/actions/build_eks_docker_image/action.yaml index 556543751..a0f8978ee 100644 --- a/.github/actions/build_eks_docker_image/action.yaml +++ b/.github/actions/build_eks_docker_image/action.yaml @@ -72,6 +72,7 @@ runs: id: copy_docker_files run: | mkdir -p ${{ inputs.artifacts_output_dir }} + cp -r ./scripts/aws/config-server/* ${{ inputs.artifacts_output_dir }} cp -r ./scripts/aws/eks/pod/* ${{ inputs.artifacts_output_dir }} ls -l ${{ inputs.artifacts_output_dir }} diff --git a/.github/workflows/publish-aws-eks-nitro-enclave-docker.yaml b/.github/workflows/publish-aws-eks-nitro-enclave-docker.yaml index 356eefdc0..70b3f1feb 100644 --- a/.github/workflows/publish-aws-eks-nitro-enclave-docker.yaml +++ b/.github/workflows/publish-aws-eks-nitro-enclave-docker.yaml @@ -137,7 +137,7 @@ jobs: steps: - name: Build Docker Image for EKS Pod id: build_docker_image - uses: IABTechLab/uid2-operator/.github/actions/build_eks_docker_image@tjm-UID2-3706-eks-eif-build + uses: IABTechLab/uid2-operator/.github/actions/build_eks_docker_image@kcc-UID2-3702-config-server with: identity_scope: uid2 artifacts_output_dir: ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/uid2 @@ -159,7 +159,7 @@ jobs: steps: - name: Build Docker Image for EKS Pod id: build_docker_image - uses: IABTechLab/uid2-operator/.github/actions/build_eks_docker_image@tjm-UID2-3706-eks-eif-build + uses: IABTechLab/uid2-operator/.github/actions/build_eks_docker_image@kcc-UID2-3702-config-server with: identity_scope: euid artifacts_output_dir: ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/euid diff --git a/config-server/__pycache__/app.cpython-310.pyc b/config-server/__pycache__/app.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef837c20468bf6d090b715e4783b3d8481864947 GIT binary patch literal 478 zcmYjNy-ve05VoD9387`+6__%#LCgptRe;3Mfx^-yigMQ`q=_TjEut$(OdWX$-hlUD z^UB04u)w7q+OzJn@Bcf?UN2-MpI`6OkTdq(8vEjsaY?Fg34j5gvx-kRXUI{!@QH)Y zqYDC@83%VQz=O^!Bfp0N{8FeBigzG@0|?iGGdLV?H0u6PKNfN8UC&cpuEKbRW+>}v zF|*Fi)jdW03QaCSXKm)b5KlHF)h#*TV-|_gDkxLaH>k}AQy%$u@Ou|OXjD3;j2u-_ z;~>kij*S7WvUpLzSs!rOf0C-yO`74>B^y+!kt)tMtoqbqi7HN;X3#v_kmx4cNIOjn z0@qPKT{cLPDlO_HS^1}f%_-grT2@#$m)cmjk;;rB-+I$_ch%OmMRi(Xl30gESWn4? n!EHZBE$ZDm+gE2(b6!bU%<-cA5q(6^Wq~*nArIVR?*9D)p1O1| literal 0 HcmV?d00001 diff --git a/scripts/aws/eks/pod/Dockerfile b/scripts/aws/eks/pod/Dockerfile index d4679c4d7..8f0097d8c 100644 --- a/scripts/aws/eks/pod/Dockerfile +++ b/scripts/aws/eks/pod/Dockerfile @@ -1,4 +1,7 @@ FROM amazonlinux:2023 + +EXPOSE 27015 + RUN yum install aws-nitro-enclaves-cli-devel jq -y RUN dnf install aws-nitro-enclaves-cli -y # RUN yum install -y libxcrypt-compat @@ -16,4 +19,9 @@ COPY ./proxies.host.yaml /home/proxies.host.yaml RUN chmod +x /home/vsockpx && chmod +x /home/entrypoint.sh # RUN yum install net-tools -y +COPY ./app.py /home/config-server/ +COPY ./requirements.txt /home/config-server/ +RUN python3 -m venv config-server +RUN config-server/bin/pip3 install -r requirements.txt + CMD ["/home/entrypoint.sh"] \ No newline at end of file diff --git a/scripts/aws/eks/pod/entrypoint.sh b/scripts/aws/eks/pod/entrypoint.sh index c42965d69..3b6d35134 100644 --- a/scripts/aws/eks/pod/entrypoint.sh +++ b/scripts/aws/eks/pod/entrypoint.sh @@ -24,6 +24,10 @@ function setup_dante() { /home/sockd -D } +function run_config_server() { + config-server/bin/flask run --host 127.0.0.1 --port 27015 +} + function run_enclave() { echo "starting enclave..." nitro-cli run-enclave --cpu-count $CPU_COUNT --memory $MEMORY_MB --eif-path $EIF_PATH --enclave-cid $CID --enclave-name simple-eif --debug-mode --attach-console @@ -32,4 +36,5 @@ function run_enclave() { terminate_old_enclave setup_vsockproxy setup_dante +run_config_server run_enclave \ No newline at end of file