Skip to content

Commit

Permalink
Add docker push workflow as separate
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelf committed Apr 21, 2024
1 parent 9fd7420 commit 5cba1e0
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 36 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/create_push_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish SymCC Docker image
# for testing only
on: [pull_request, workflow_dispatch]
# we want to push a docker image when the Compile and test SymCC
# workflow completed successfully
# on:
# workflow_run:
# workflows: [Compile and test SymCC] # Reuse the name of your tests workflow
# branches: master
# types:
# - completed

jobs:
upload_dockerhub:
# if: github.repository == 'eurecom-s3/symcc' && github.ref == 'refs/heads/master'
# not when testing
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
needs: [ llvm_compatibility, llvm_compatibility_latest_llvm ]
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/symcc:latest
53 changes: 21 additions & 32 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
name: Compile and test SymCC
on: [pull_request, workflow_dispatch]
jobs:
# Building and running the tests with Dockerfile
build_and_test_symcc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup docker compilation environment
run: docker build --target builder -t symcc .
- name: Build and test SymCC with simple backend
run: docker build --target builder_simple -t symcc .
- name: Build libcxx using SymCC simple backend
run: docker build --target builder_libcxx -t symcc .
- name: Build and test SymCC with Qsym backend
run: docker build --target builder_qsym -t symcc .
- name: Creation of the final SymCC docker image with Qsym backend and libcxx

# checking compatibility with ubuntu llvm packages
llvm_compatibility:
runs-on: ubuntu-22.04
strategy:
Expand All @@ -15,7 +31,7 @@ jobs:
sudo apt-get update
sudo apt-get install -y \
llvm-${{ matrix.llvm_version }}-dev \
libz3-dev \
libz3-dev
- name: Build SymCC with the QSYM backend
run: |
mkdir build
Expand All @@ -26,7 +42,9 @@ jobs:
-DQSYM_BACKEND=ON \
-DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \
..
make
make tests
# checking compatibility (compilation only) with more recent packages
llvm_compatibility_latest_llvm:
runs-on: ubuntu-22.04
strategy:
Expand Down Expand Up @@ -59,33 +77,4 @@ jobs:
-DQSYM_BACKEND=ON \
-DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \
..
make
# 1- This is all open source anyway, so I figure anyone working on this should maybe create a DockerHub account
# and create secrets to store their username and password to test uploading their changes to symcc.
# Also, deleting the old workflow, as if I kept it, this would build the Docker image twice.
# 2- We should only build and push to DockerHub if this passes all tests
upload_dockerhub:
# if: github.repository == 'eurecom-s3/symcc' && github.ref == 'refs/heads/master'
needs: [ llvm_compatibility, llvm_compatibility_latest_llvm ]
runs-on: ubuntu-latest
steps:
- name: Checkout project sources
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/symcc:latest
make tests
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,16 @@ contains detailed instructions to replicate our experiments, as well as the raw
results that we obtained.
### Video demonstration
On YouTube you can find [a practical introduction to SymCC](https://www.youtube.com/watch?v=htDrNBiL7Y8) as well as a video on [how to combine AFL and SymCC](https://www.youtube.com/watch?v=zmC-ptp3W3k)
On YouTube you can find [a practical introduction to
SymCC](https://www.youtube.com/watch?v=htDrNBiL7Y8) as well as a video on [how
to combine AFL and SymCC](https://www.youtube.com/watch?v=zmC-ptp3W3k)
## Building a Docker image
If you prefer a Docker container over building SymCC natively, just tell Docker
to build the image after pulling the QSYM code as above. (Be warned though: the
Docker image enables optional C++ support from source, so creating
the image can take quite some time!)
Docker image enables optional C++ support from source, so creating the image can
take quite some time!)
```
$ git submodule init
Expand All @@ -157,7 +159,9 @@ $ docker build -t symcc .
$ docker run -it --rm symcc
```
Alternatively, you can pull from docker hub
Alternatively, you can pull an existing image (current master branch) from
Docker Hub:
```
$ docker pull eurecoms3/symcc
$ docker run -it --rm symcc
Expand Down

0 comments on commit 5cba1e0

Please sign in to comment.