From 459f36c0bd475fd6cb3f3127aaca119641fbc937 Mon Sep 17 00:00:00 2001 From: Adam Teuscher Date: Tue, 13 Sep 2022 09:57:26 -0600 Subject: [PATCH 1/2] Update curl command for Google Drive weights and adjust yaml files (#4736) --- CHANGELOG.md | 2 +- .../pytorch/saic-vul/fbrs/nuclio/function.yaml | 4 +--- .../saic-vul/hrnet/nuclio/function-gpu.yaml | 4 ++++ .../shiyinzhang/iog/nuclio/function.yaml | 18 +++++++++--------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7268f099d2f..98b495dcfda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - TDB ### Fixed -- TDB +- Update serverless function yamls () ### Security - TDB diff --git a/serverless/pytorch/saic-vul/fbrs/nuclio/function.yaml b/serverless/pytorch/saic-vul/fbrs/nuclio/function.yaml index fa53090b449..6b11b2ff988 100644 --- a/serverless/pytorch/saic-vul/fbrs/nuclio/function.yaml +++ b/serverless/pytorch/saic-vul/fbrs/nuclio/function.yaml @@ -37,9 +37,7 @@ spec: - kind: ENV value: filename=resnet101_dh256_sbd.pth - kind: RUN - value: curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" - - kind: RUN - value: curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename} + value: curl -L "https://drive.google.com/uc?export=download&confirm=t&id=${fileid}" -o ${filename} - kind: RUN value: apt update && apt install -y libgl1-mesa-glx - kind: RUN diff --git a/serverless/pytorch/saic-vul/hrnet/nuclio/function-gpu.yaml b/serverless/pytorch/saic-vul/hrnet/nuclio/function-gpu.yaml index e3039b7778e..d8471a3fa4b 100644 --- a/serverless/pytorch/saic-vul/hrnet/nuclio/function-gpu.yaml +++ b/serverless/pytorch/saic-vul/hrnet/nuclio/function-gpu.yaml @@ -32,8 +32,12 @@ spec: value: apt-get update && apt-get install software-properties-common -y - kind: RUN value: add-apt-repository ppa:deadsnakes/ppa + - kind: RUN + value: apt remove python* -y - kind: RUN value: apt-get update && apt-get install -y --no-install-recommends build-essential git curl libglib2.0-0 software-properties-common python3 python3.6-dev python3-pip python3-tk + - kind: RUN + value: ln -s /usr/bin/pip3 /usr/local/bin/pip && ln -s /usr/bin/python3 /usr/bin/python - kind: RUN value: pip3 install --upgrade pip - kind: WORKDIR diff --git a/serverless/pytorch/shiyinzhang/iog/nuclio/function.yaml b/serverless/pytorch/shiyinzhang/iog/nuclio/function.yaml index 3b979ee6c26..f02a550b64a 100644 --- a/serverless/pytorch/shiyinzhang/iog/nuclio/function.yaml +++ b/serverless/pytorch/shiyinzhang/iog/nuclio/function.yaml @@ -14,7 +14,7 @@ metadata: spec: description: Interactive Object Segmentation with Inside-Outside Guidance - runtime: 'python:3.6' + runtime: 'python:3.9' handler: main:handler eventTimeout: 30s env: @@ -30,15 +30,19 @@ spec: - kind: WORKDIR value: /opt/nuclio - kind: RUN - value: conda create -y -n iog python=3.6 + value: conda create -y -n iog python=3.9 - kind: SHELL value: '["conda", "run", "-n", "iog", "/bin/bash", "-c"]' - kind: RUN value: conda install -y -c anaconda curl - kind: RUN - value: conda install -y pytorch=0.4 torchvision=0.2 -c pytorch + value: conda install -y pytorch torchvision -c pytorch - kind: RUN - value: conda install -y -c conda-forge pycocotools opencv scipy + value: apt update && apt install -y libgl1-mesa-glx + - kind: RUN + value: conda install -y -c conda-forge pycocotools scipy + - kind: RUN + value: pip install opencv-python==4.5.5.64 - kind: RUN value: git clone https://github.com/shiyinzhang/Inside-Outside-Guidance.git iog - kind: WORKDIR @@ -48,11 +52,7 @@ spec: - kind: ENV value: filename=IOG_PASCAL_SBD.pth - kind: RUN - value: curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" - - kind: RUN - value: echo "/download/ {print \$NF}" > confirm_code.awk - - kind: RUN - value: curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk -f confirm_code.awk ./cookie`&id=${fileid}" -o ${filename} + value: curl -L "https://drive.google.com/uc?export=download&confirm=t&id=${fileid}" -o ${filename} - kind: WORKDIR value: /opt/nuclio - kind: ENTRYPOINT From f6bc2edcd9bb4cdc6d63e8078ab8c142d9160110 Mon Sep 17 00:00:00 2001 From: Adam Teuscher Date: Wed, 5 Oct 2022 16:54:32 -0600 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f898d6700e2..89d8dfd5909 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ non-ascii paths while adding files from "Connected file share" (issue #4428) - IOG and f-BRS serverless function () - Invisible label item in label constructor when label color background is white, or close to it () +- HRNET serverless function () ### Security - TDB