Skip to content

Commit

Permalink
Merge pull request #20 from Vastra-Gotalandsregionen/AI-421
Browse files Browse the repository at this point in the history
AI-421: Add support for both VGC Issuing v2 intermediate certificates
  • Loading branch information
luksi1 authored Sep 26, 2022
2 parents 73c118c + 5dc041f commit 8ec43eb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 18 deletions.
13 changes: 7 additions & 6 deletions tests/test_pytorch_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
11 changes: 6 additions & 5 deletions tests/test_r_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 6 additions & 6 deletions tests/test_tensorflow_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down
3 changes: 2 additions & 1 deletion {{ cookiecutter.repo_name }}/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8ec43eb

Please sign in to comment.