Skip to content

Commit 0140ecf

Browse files
committed
Draft of new workflow to
push compressed attack data archive to S3. Remove txt file that should not be in the root of the repo.
1 parent 97e0379 commit 0140ecf

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: mirror-archive-on-merge-to-default-branch
2+
3+
on:
4+
push:
5+
# branches:
6+
# - master
7+
8+
jobs:
9+
mirror-archive:
10+
runs-on: ubuntu-latest
11+
env:
12+
BUCKET: attack-range-data
13+
ATTACK_DATA_ARCHIVE_FILE: attack_data.tar.zstd
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v4
17+
18+
# - name: Setup AWS CLI and Credentials
19+
# uses: aws-actions/configure-aws-credentials@v4
20+
# with:
21+
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
22+
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
# aws-region: us-west-2
24+
25+
- name: Create archive of ONLY the datasets folder
26+
run: |
27+
# The structure of the tar + zstd archive should mirror that of checking out the repo directly
28+
mkdir attack_data
29+
mv datasets/ attack_data/.
30+
31+
# Compress with number of threads equal to number of CPU cores.
32+
# Compression level 10 is a great compromise of speed and file size.
33+
# File size reductions are diminishing returns after this - determined experimentally.
34+
time tar -c attack_data | zstd --compress -T0 -10 -o $ATTACK_DATA_ARCHIVE_FILE
35+
ls -lah attack_data.tar.zstd
36+
37+
38+
# - name: Upload Attack data archive file to S3 Bucket
39+
# run: |
40+
# aws s3 cp $ATTACK_DATA_ARCHIVE_FILE s3://$BUCKET/
41+
# aws s3api put-object-acl --bucket $BUCKET --key $ATTACK_DATA_ARCHIVE_FILE --acl public-read
42+

testfile.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)