From 884991097e67cb5e974acbe6d0f62ddde0dbeaf2 Mon Sep 17 00:00:00 2001 From: luksi1 Date: Fri, 23 Sep 2022 09:30:15 +0000 Subject: [PATCH 1/2] AI-421: Add support for both VGC Issuing v2 intermediate certificates --- {{ cookiecutter.repo_name }}/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{ cookiecutter.repo_name }}/Dockerfile b/{{ cookiecutter.repo_name }}/Dockerfile index 5f6a593bf..6ae6d47eb 100644 --- a/{{ cookiecutter.repo_name }}/Dockerfile +++ b/{{ cookiecutter.repo_name }}/Dockerfile @@ -12,12 +12,13 @@ RUN apt -y update \ ADD http://aiav2.vgregion.se/VGC%20Root%20CA%20v2.crt /tmp/vgc_root.der ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2.crt /tmp/vgc_issuing1.der ADD http://aiav2.vgregion.se/VGC%20Issuing%202%20CA%20v2.crt /tmp/vgc_issuing2.der - +ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2(1).crt /tmp/vgc_issuing1_2.der COPY requirements.txt setup.py ./ RUN pip install -r requirements.txt \ && openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt \ + && openssl x509 -inform der -in /tmp/vgc_issuing1_2.der -out /usr/local/share/ca-certificates/vgc_issuing1_2.crt \ && openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt \ && update-ca-certificates From 5dc041fe676e629e6583130199d01b8b3f11007f Mon Sep 17 00:00:00 2001 From: luksi1 Date: Mon, 26 Sep 2022 11:16:19 +0000 Subject: [PATCH 2/2] Updated tests --- tests/test_pytorch_env.py | 13 +++++++------ tests/test_r_env.py | 11 ++++++----- tests/test_tensorflow_env.py | 12 ++++++------ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/tests/test_pytorch_env.py b/tests/test_pytorch_env.py index 8478195af..ae3a04a3b 100644 --- a/tests/test_pytorch_env.py +++ b/tests/test_pytorch_env.py @@ -92,12 +92,13 @@ def test_dockerfile(self): assert "ADD http://aiav2.vgregion.se/VGC%20Root%20CA%20v2.crt /tmp/vgc_root.der" in lines assert "ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2.crt /tmp/vgc_issuing1.der" in lines assert "ADD http://aiav2.vgregion.se/VGC%20Issuing%202%20CA%20v2.crt /tmp/vgc_issuing2.der" in lines - assert """RUN pip install -r requirements.txt \\ - && openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt \\ - && openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt \\ - && openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt \\ - && update-ca-certificates""" in dockerfile_text - + assert "pip install -r requirements.txt" + assert "openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing1_2.der -out /usr/local/share/ca-certificates/vgc_issuing1_2.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt" + assert "update-ca-certificates" + def test_folders(self): module_name = "project_name" if pytest.param.get("project_name"): diff --git a/tests/test_r_env.py b/tests/test_r_env.py index 0145cf516..ea0ee359a 100644 --- a/tests/test_r_env.py +++ b/tests/test_r_env.py @@ -55,11 +55,12 @@ def test_dockerfile(self): assert "ADD http://aiav2.vgregion.se/VGC%20Root%20CA%20v2.crt /tmp/vgc_root.der" in lines assert "ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2.crt /tmp/vgc_issuing1.der" in lines assert "ADD http://aiav2.vgregion.se/VGC%20Issuing%202%20CA%20v2.crt /tmp/vgc_issuing2.der" in lines - assert """RUN pip install -r requirements.txt \\ - && openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt \\ - && openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt \\ - && openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt \\ - && update-ca-certificates""" in dockerfile_text + assert "pip install -r requirements.txt" + assert "openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing1_2.der -out /usr/local/share/ca-certificates/vgc_issuing1_2.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt" + assert "update-ca-certificates" def test_folders(self): module_name = pytest.param.get("project_name") diff --git a/tests/test_tensorflow_env.py b/tests/test_tensorflow_env.py index cd07774b4..2aaecfc72 100644 --- a/tests/test_tensorflow_env.py +++ b/tests/test_tensorflow_env.py @@ -92,12 +92,12 @@ def test_dockerfile(self): assert "ADD http://aiav2.vgregion.se/VGC%20Root%20CA%20v2.crt /tmp/vgc_root.der" in lines assert "ADD http://aiav2.vgregion.se/VGC%20Issuing%201%20CA%20v2.crt /tmp/vgc_issuing1.der" in lines assert "ADD http://aiav2.vgregion.se/VGC%20Issuing%202%20CA%20v2.crt /tmp/vgc_issuing2.der" in lines - assert """RUN pip install -r requirements.txt \\ - && openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt \\ - && openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt \\ - && openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt \\ - && update-ca-certificates""" in dockerfile_text - + assert "pip install -r requirements.txt" + assert "openssl x509 -inform der -in /tmp/vgc_root.der -out /usr/local/share/ca-certificates/vgc_root.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing1.der -out /usr/local/share/ca-certificates/vgc_issuing1.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing1_2.der -out /usr/local/share/ca-certificates/vgc_issuing1_2.crt" + assert "openssl x509 -inform der -in /tmp/vgc_issuing2.der -out /usr/local/share/ca-certificates/vgc_issuing2.crt" + assert "update-ca-certificates" def test_folders(self): module_name = "project_name" if pytest.param.get("project_name"):