-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change approach for ci: initial container build
- Loading branch information
Showing
3 changed files
with
77 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# TODO: make this variable to select different python versions (and manually set a default one) | ||
FROM python:3.12-bookworm | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the application files to the container | ||
COPY . /app | ||
|
||
# Create /pcap directory for config and pcap files | ||
RUN mkdir /pcap | ||
|
||
# Install the Python dependencies | ||
RUN pip install -r requirements.txt | ||
|
||
# Set the entry point command | ||
# CMD ["python", "./main.py", "--cfg", "/pcap/traffic-reproducer.conf"] | ||
CMD ["python", "./main.py", "-h"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
exec > /pcap/run_traffic_reproducer.log | ||
exec 2>&1 | ||
|
||
echo "$( date ) Running traffic reproducer multi" | ||
|
||
pids=() | ||
pcap_folders=( $( ls -d /pcap/*/ ) ) | ||
echo "$( date ) ${#pcap_folders[@]} folders found: ${pcap_folders[@]}" | ||
|
||
for value in ${pcap_folders[@]}; do | ||
# sleep 1 | ||
echo "$( date ) Running ${value}traffic-reproducer.yml" | ||
python3 main.py -t ${value}traffic-reproducer.yml -v > ${value}traffic-reproducer.log 2>&1 & | ||
pid=$! | ||
echo "$( date ) Spawned PID $pid" | ||
pids+=(${pid}) | ||
done | ||
|
||
echo "$( date ) All spawned PIDs: ${pids[@]}" | ||
echo "$( date ) All processes spawned, now waiting" | ||
|
||
for pid in "${pids[@]}"; do | ||
echo "$( date ) Waiting for PID $pid" | ||
wait $pid | ||
done | ||
echo "$( date ) All processes finished" |