Skip to content

Commit

Permalink
DockerHub push (#168)
Browse files Browse the repository at this point in the history
* Pushing docker image to DockerHub, only if all tests pass

---------

Co-authored-by: AndrewQuijano <[email protected]>
Co-authored-by: Andrew <[email protected]>
  • Loading branch information
3 people authored Apr 21, 2024
1 parent c89b6cc commit 6b32a38
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
coding_style:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run clang-format
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/create_push_docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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]
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' }}
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
13 changes: 9 additions & 4 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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:
Expand All @@ -15,21 +16,23 @@ jobs:
run: docker build --target builder_qsym -t symcc .
- name: Creation of the final SymCC docker image with Qsym backend and libcxx
run: docker build -t symcc .

# checking compatibility with ubuntu llvm packages
llvm_compatibility:
runs-on: ubuntu-22.04
strategy:
matrix:
llvm_version: [11, 12, 13, 14, 15]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: |
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 @@ -41,13 +44,15 @@ jobs:
-DLLVM_DIR=/usr/lib/llvm-${{ matrix.llvm_version }}/cmake \
..
make
# checking compatibility (compilation only) with more recent packages
llvm_compatibility_latest_llvm:
runs-on: ubuntu-22.04
strategy:
matrix:
llvm_version: [16, 17, 18]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true
- name: Add LLVM project deb repository
Expand All @@ -62,7 +67,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 Down
16 changes: 13 additions & 3 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,6 +159,14 @@ $ docker build -t symcc .
$ docker run -it --rm symcc
```
Alternatively, you can pull an existing image (current master branch) from
Docker Hub:
```
$ docker pull eurecoms3/symcc
$ docker run -it --rm symcc
```
This will build a Docker image and run an ephemeral container to try out SymCC.
Inside the container, `symcc` is available as a drop-in replacement for `clang`,
using the QSYM backend; similarly, `sym++` can be used instead of `clang++`. Now
Expand Down

0 comments on commit 6b32a38

Please sign in to comment.