Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #33 docker image fix #34

Merged
merged 3 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 3 additions & 65 deletions e2etest/provider_cfg/all/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,79 +1,17 @@
# Copyright 2021 Contributors to the Parsec project.
# SPDX-License-Identifier: Apache-2.0

FROM tpm2software/tpm2-tss:ubuntu-18.04

ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig

RUN apt-get update && \
apt-get install -y git make gcc python3 python curl wget cmake && \
apt-get install -y automake autoconf libtool pkg-config libssl-dev libgcc1 && \
# These libraries are needed for bindgen as it uses libclang.so
apt-get install -y clang libclang-dev libc6-dev-i386

WORKDIR /tmp
RUN wget https://github.com/ARMmbed/mbed-crypto/archive/mbedcrypto-2.0.0.tar.gz
RUN tar xf mbedcrypto-2.0.0.tar.gz
RUN cd mbed-crypto-mbedcrypto-2.0.0 \
&& make SHARED=0

WORKDIR /tmp
# Download and install SoftHSM2
RUN git clone https://github.com/opendnssec/SoftHSMv2.git \
&& cd SoftHSMv2 \
&& git reset --hard 20a53bd083a6134ce2230f80edda5dc8be0366bd

RUN cd SoftHSMv2 \
&& sh autogen.sh \
# Autogen might fail because of some limitations of autoconf, see:
# https://bugzilla.redhat.com/show_bug.cgi?id=1826935#c3
|| sh autogen.sh
RUN cd SoftHSMv2 \
&& ./configure --disable-gost \
&& make \
&& make install

# Download and install TSS 2.0
RUN git clone https://github.com/tpm2-software/tpm2-tss.git --branch 2.3.3
RUN cd tpm2-tss \
&& ./bootstrap \
&& ./configure \
&& make -j$(nproc) \
&& make install \
&& ldconfig

# Download and install TPM2 tools
RUN git clone https://github.com/tpm2-software/tpm2-tools.git --branch 4.1
RUN cd tpm2-tools \
&& ./bootstrap \
&& ./configure --enable-unit \
&& make install

# Create a new token in a new slot. The slot number assigned will be random
# and is found with the find_slot_number script.
RUN softhsm2-util --init-token --slot 0 --label "Parsec Tests" --pin 123456 --so-pin 123456

# Add users for multitenancy tests
RUN useradd -m parsec-client-1
RUN useradd -m parsec-client-2

USER parsec-client-1
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

USER parsec-client-2
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
FROM ghcr.io/parallaxsecond/parsec-service-test-all

# Install Rust toolchain for root
USER root
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"

# Download the SPIRE server and agent
RUN curl -s -N -L https://github.com/spiffe/spire/releases/download/v0.11.1/spire-0.11.1-linux-x86_64-glibc.tar.gz | tar xz

# Install go 15
# Install go 1.16

RUN curl -s -N -L https://golang.org/dl/go1.15.7.linux-amd64.tar.gz | tar xz -C /usr/local
RUN curl -s -N -L https://golang.org/dl/go1.16.linux-amd64.tar.gz | tar xz -C /usr/local
ENV PATH="/usr/local/go/bin:${PATH}"

RUN git clone https://github.com/parallaxsecond/parsec
Expand Down
29 changes: 0 additions & 29 deletions e2etest/provider_cfg/mbed-crypto/Dockerfile

This file was deleted.

30 changes: 0 additions & 30 deletions e2etest/provider_cfg/mbed-crypto/config.toml

This file was deleted.

48 changes: 0 additions & 48 deletions e2etest/provider_cfg/pkcs11/Dockerfile

This file was deleted.

35 changes: 0 additions & 35 deletions e2etest/provider_cfg/pkcs11/config.toml

This file was deleted.

41 changes: 0 additions & 41 deletions e2etest/provider_cfg/tpm/Dockerfile

This file was deleted.

32 changes: 0 additions & 32 deletions e2etest/provider_cfg/tpm/config.toml

This file was deleted.

17 changes: 0 additions & 17 deletions e2etest/scripts/ci-mbed-crypto.sh

This file was deleted.

17 changes: 0 additions & 17 deletions e2etest/scripts/ci-pkcs11.sh

This file was deleted.

17 changes: 0 additions & 17 deletions e2etest/scripts/ci-tpm.sh

This file was deleted.

4 changes: 2 additions & 2 deletions e2etest/scripts/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ if [ "$PROVIDER_NAME" = "tpm" ] || [ "$PROVIDER_NAME" = "all" ]; then
tpm_server &
TPM_SRV_PID=$!
sleep 5
tpm2_startup -c -T mssim
tpm2_changeauth -c owner tpm_pass
tpm2_startup -c 2>/dev/null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's that script that the container is meant to run, you could also add the Go installation steps here? So at least you wouldn't need to build the container.
Not ideal though if you want to run the script locally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

script gets used locally and in CI - see comment: #34 (comment)

tpm2_takeownership -o tpm_pass 2>/dev/null
# tpm2_startup -c -T mssim 2>/dev/null
# tpm2_changeauth -c owner tpm_pass 2>/dev/null
fi
Expand Down