File tree 6 files changed +109
-6
lines changed
6 files changed +109
-6
lines changed Original file line number Diff line number Diff line change
1
+ # Using Python original Docker image
2
+ FROM --platform=linux/amd64 python:3.9-alpine
3
+
4
+ # Install necessary packages
5
+ RUN apk add \
6
+ curl \
7
+ build-base \
8
+ libffi-dev
9
+
10
+ RUN curl https://sh.rustup.rs -sSf -o rustup.sh ; chmod +x rustup.sh ; ./rustup.sh -y
11
+ ENV PATH="$PATH:/root/.cargo/bin"
12
+
13
+ # Create code directory, output directory
14
+ RUN mkdir /job_preparation
15
+
16
+ # Copy useful data from the project
17
+ COPY ./client/job_preparation /job_preparation
18
+
19
+ # Copy utils for SPIFFEID creation ...
20
+ COPY ./utils /job_preparation/utils
21
+
22
+ # Install dependencies
23
+ RUN cd /job_preparation && pip install -r ./requirements.txt
24
+
25
+ # Set workdir
26
+ WORKDIR /job_preparation
27
+
28
+ # Set entrypoint
29
+ ENTRYPOINT [ "python3" , "./prepare_job.py" ]
Original file line number Diff line number Diff line change
1
+ cryptography == 42.0.5
2
+ pyOpenSSL == 24.0.0
3
+ protobuf == 3.20.0
4
+ pyyaml == 5.3.1
5
+ pyrage == 1.1.2
6
+ paramiko == 3.4.0
7
+ scp == 0.14.5
8
+ pre-commit
Original file line number Diff line number Diff line change
1
+ # Using Python original Docker image
2
+ FROM --platform=linux/amd64 python:3.9-alpine
3
+
4
+ RUN apk add \
5
+ git \
6
+ build-base \
7
+ openssl
8
+
9
+ # Install spire-agent
10
+ RUN wget -q https://github.com/spiffe/spire/releases/download/v1.9.0/spire-1.9.0-linux-amd64-musl.tar.gz
11
+ RUN tar xvf spire-1.9.0-linux-amd64-musl.tar.gz ; mv spire-1.9.0 /opt ; mv /opt/spire-1.9.0 /opt/spire
12
+ RUN ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent
13
+
14
+ # Install pyspiffe package
15
+ RUN pip install git+https://github.com/HewlettPackard/py-spiffe.git
16
+
17
+ # Copy server
18
+ RUN mkdir /server
19
+ COPY ./server /server
20
+
21
+ # Install dependencies
22
+ RUN cd /server && pip install -r ./requirements.txt
23
+
24
+ # Copy utils
25
+ COPY ./utils /server/utils
26
+
27
+ # Set workdir
28
+ WORKDIR /server
29
+
30
+ # Set entrypoint
31
+ ENTRYPOINT [ "./entrypoint.sh" ]
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # # This entrypoint wraps the HPCS server with a spire agent
4
+ #
5
+
6
+ # export PYTHONPATH="${PYTHONPATH}:/server:/utils"
7
+
8
+ # Cleanup spire-agent generated files
9
+ end_entrypoint () {
10
+ echo " Cleaning everything before leaving ..."
11
+ rm -rf /tmp/data
12
+ rm -r /tmp/spire-agent
13
+ kill " $1 "
14
+ exit " $2 "
15
+ }
16
+
17
+ # Reset spire data everytime
18
+ rm -rf /tmp/data
19
+
20
+ # Spawn spire agent with mounted configuration
21
+ spire-agent run -config /tmp/agent.conf || end_entrypoint 0 1 &
22
+ spire_agent_pid=$!
23
+
24
+ agent_socket_path=$( cat /tmp/agent.conf | grep " socket_path" | cut -d " =" -f2 | cut -d " \" " -f1)
25
+
26
+ sleep 10
27
+ until [ -e $agent_socket_path ]
28
+ do
29
+ echo -e " ${RED} [LUMI-SD][Data preparation] Spire workload api socket doesn't exist, waiting 10 seconds ${NC} "
30
+ sleep 10
31
+ done
32
+
33
+ python3 ./app.py || end_entrypoint $spire_agent_pid 1
34
+
35
+ end_entrypoint $spire_agent_pid 0
Original file line number Diff line number Diff line change 8
8
pre_command = "microk8s.kubectl exec -n spire spire-server-0 --"
9
9
10
10
11
- jwt_workload_api = default_jwt_source .DefaultJwtSource (
12
- spiffe_socket_path = "unix:///tmp/spire-agent/public/api.sock"
11
+ jwt_workload_api = default_jwt_source .DefaultJwtSource (
12
+ workload_api_client = None ,
13
+ spiffe_socket_path = "unix:///tmp/spire-agent/public/api.sock" ,
14
+ timeout_in_seconds = None
13
15
)
14
16
15
17
Original file line number Diff line number Diff line change 1
- cryptography == 2.8
2
- dockerfile_parse == 2.0.1
3
- pyOpenSSL == 19.0.0
4
- docker == 7.0.0
1
+ cryptography == 42.0.5
2
+ pyOpenSSL == 24.0.0
5
3
protobuf == 3.20.0
6
4
hvac == 2.1.0
7
5
quart == 0.19.4
You can’t perform that action at this time.
0 commit comments