-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#2145] Dockerisation of RepoSense #2149
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2eb525a
Add initial POC for Docker
georgetayqy 16fe1dc
Add Dockerfiles for Ubuntu builds
georgetayqy c0d68dd
Update Ubuntu Images
georgetayqy cd43d95
Fix missing EOF
georgetayqy 0462602
Merge branch 'master' into add-docker-support
georgetayqy 6d4e0c4
Update workflow and Dockerfiles
georgetayqy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Include any files or directories that you don't want to be copied to your | ||
# container here (e.g., local build artifacts, temporary files, etc.). | ||
# | ||
# For more help, visit the .dockerignore file reference guide at | ||
# https://docs.docker.com/go/build-context-dockerignore/ | ||
|
||
**/.DS_Store | ||
**/__pycache__ | ||
**/.venv | ||
**/.classpath | ||
**/.dockerignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
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,49 @@ | ||
name: Builds Docker Images | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- gh-pages | ||
pull_request: | ||
branches-ignore: | ||
- gh-pages | ||
|
||
env: | ||
OUTDIR: "out" | ||
|
||
jobs: | ||
build-test-containers: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dockerfile: ./docker/Dockerfile.ubuntu2004 | ||
tag: asdfghjklxd/reposense-docker-test:ubuntu-20-04 | ||
os: Ubuntu 20.04 | ||
- dockerfile: ./docker/Dockerfile.ubuntu2204 | ||
tag: asdfghjklxd/reposense-docker-test:ubuntu-22-04 | ||
os: Ubuntu 22.04 | ||
name: ${{ matrix.os }} (Java 8, 11) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout V4 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build Docker Image | ||
run: | | ||
docker build -t ${{ matrix.tag }} -f ${{ matrix.dockerfile }} -o ${{ env.OUTDIR }} . | ||
# - name: Upload Code Coverage (Java 8) | ||
# if: ${{ success() }} | ||
# uses: codecov/codecov-action@v3 | ||
# with: | ||
# directory: ${{ github.workspace }}/${{ env.OUTDIR }}/reports/java8 | ||
# files: coverage.xml | ||
# fail_ci_if_error: true | ||
# - name: Upload Code Coverage (Java 11) | ||
# if: ${{ success() }} | ||
# uses: codecov/codecov-action@v3 | ||
# with: | ||
# directory: ${{ github.workspace }}/${{ env.OUTDIR }}/reports/java11 | ||
# files: coverage.xml | ||
# fail_ci_if_error: true |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As discussed, since we're not using this for the CI, we can probably put this in a folder marked for local testing. |
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,32 @@ | ||
version: "3" | ||
services: | ||
RepoSense-Ubuntu-20.04: | ||
container_name: RepoSense-Ubuntu-20.04 | ||
build: | ||
dockerfile: docker/Dockerfile.ubuntu2004 | ||
image: reposense-ubuntu-20.04:latest | ||
RepoSense-Ubuntu-22.04: | ||
container_name: RepoSense-Ubuntu-22.04 | ||
build: | ||
dockerfile: docker/Dockerfile.ubuntu2204 | ||
image: reposense-ubuntu-22.04:latest | ||
# RepoSense-Windows-Server-2019: | ||
# container_name: RepoSense-Windows-Server-2019 | ||
# build: | ||
# dockerfile: docker/Dockerfile.windows2019 | ||
# image: reposense-windows-server-2019:latest | ||
# RepoSense-Windows-Server-2022: | ||
# container_name: RepoSense-Windows-Server-2022 | ||
# build: | ||
# dockerfile: docker/Dockerfile.windows2022 | ||
# image: reposense-windows-server-2022:latest | ||
# RepoSense-MacOS-Big-Sur: | ||
# container_name: RepoSense-MacOS-Big-Sur | ||
# build: | ||
# dockerfile: docker/Dockerfile.macos-big-sur | ||
# image: reposense-macos:latest | ||
# RepoSense-MacOS-Monterey: | ||
# container_name: RepoSense-MacOS-Monterey | ||
# build: | ||
# dockerfile: docker/Dockerfile.macos-monterey | ||
# image: reposense-macos:latest |
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,75 @@ | ||
#!/usr/bin/docker | ||
# ██████ ███████ ██████ ██████ ███████ ███████ ███ ██ ███████ ███████ | ||
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ | ||
# ██████ █████ ██████ ██ ██ ███████ █████ ██ ██ ██ ███████ █████ | ||
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ | ||
# ██ ██ ███████ ██ ██████ ███████ ███████ ██ ████ ███████ ███████ | ||
# | ||
# Title: Ubuntu LTS 20.04 Builds | ||
# Author: George Tay | ||
# Version: 0.1 | ||
# License: MIT (see main repository for Licensing information | ||
# | ||
# Dockerfile format inspired by https://github.com/sickcodes/Docker-OSX/blob/master/Dockerfile.naked | ||
# | ||
# These are some of the resources which I heavily referenced to create this Dockerfile: | ||
# - Passing Arguments into Docker Containers | ||
# - https://stackoverflow.com/questions/40873165/use-docker-run-command-to-pass-arguments-to-cmd-in-dockerfile | ||
# - Installation of Java on Ubuntu | ||
# - https://stackoverflow.com/questions/49914574/install-jdk-8-update-172-in-dockerfile-with-ubuntu-image | ||
# - Installation of NodeJS via Node Version Manager (NVM) | ||
# - https://stackoverflow.com/questions/36399848/install-node-in-dockerfile | ||
|
||
FROM asdfghjklxd/reposense-images:ubuntu-20-04 AS setup-env | ||
|
||
LABEL os=ubuntu | ||
LABEL "os.version"="20.04" | ||
LABEL java="8, 11" | ||
LABEL node="16.20.2" | ||
LABEL maintainer="George Tay" | ||
|
||
WORKDIR /RepoSense | ||
|
||
# copy over all files | ||
COPY . . | ||
|
||
# allow gradlew to be executable | ||
RUN chmod +x gradlew | ||
|
||
# make the report directory | ||
RUN mkdir reports | ||
|
||
# test java 8 | ||
RUN export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 && \ | ||
update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64; | ||
RUN ./gradlew environmentalChecks | ||
RUN ./gradlew lintFrontend | ||
RUN ./gradlew clean | ||
RUN ./gradlew test | ||
RUN ./gradlew systemTest | ||
RUN ./gradlew checkstyleAll | ||
# RUN ./gradlew clean | ||
# RUN ./gradlew frontendTest -Pci | ||
RUN ./gradlew coverage | ||
RUN cp -rf ./build/reports/jacoco/coverage reports/ | ||
RUN mv -f reports/coverage reports/java8 | ||
|
||
# test java 11 | ||
RUN export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 && \ | ||
update-java-alternatives --set /usr/lib/jvm/java-1.11.0-openjdk-amd64; | ||
RUN ./gradlew clean | ||
RUN ./gradlew environmentalChecks | ||
RUN ./gradlew lintFrontend | ||
RUN ./gradlew clean | ||
RUN ./gradlew test | ||
RUN ./gradlew systemTest | ||
RUN ./gradlew checkstyleAll | ||
# RUN ./gradlew clean | ||
# RUN ./gradlew frontendTest -Pci | ||
RUN ./gradlew coverage | ||
RUN cp -rf ./build/reports/jacoco/coverage reports/ | ||
RUN mv -f reports/coverage reports/java11 | ||
|
||
# export reports | ||
FROM scratch AS report-exporter | ||
COPY --from=setup-env RepoSense/reports /reports |
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,74 @@ | ||||||
#!/usr/bin/docker | ||||||
# ██████ ███████ ██████ ██████ ███████ ███████ ███ ██ ███████ ███████ | ||||||
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ | ||||||
# ██████ █████ ██████ ██ ██ ███████ █████ ██ ██ ██ ███████ █████ | ||||||
# ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ | ||||||
# ██ ██ ███████ ██ ██████ ███████ ███████ ██ ████ ███████ ███████ | ||||||
# | ||||||
# Title: Ubuntu LTS 22.04 Builds | ||||||
# Author: George Tay | ||||||
# Version: 0.1 | ||||||
# License: MIT (see main repository for Licensing information | ||||||
# | ||||||
# Dockerfile format inspired by https://github.com/sickcodes/Docker-OSX/blob/master/Dockerfile.naked | ||||||
# | ||||||
# These are some of the resources which I heavily referenced to create this Dockerfile: | ||||||
# - Passing Arguments into Docker Containers | ||||||
# - https://stackoverflow.com/questions/40873165/use-docker-run-command-to-pass-arguments-to-cmd-in-dockerfile | ||||||
# - Installation of Java on Ubuntu | ||||||
# - https://stackoverflow.com/questions/49914574/install-jdk-8-update-172-in-dockerfile-with-ubuntu-image | ||||||
# - Installation of NodeJS via Node Version Manager (NVM) | ||||||
# - https://stackoverflow.com/questions/36399848/install-node-in-dockerfile | ||||||
|
||||||
FROM asdfghjklxd/reposense-images:ubuntu-22-04 AS setup-env | ||||||
|
||||||
LABEL os=ubuntu | ||||||
LABEL "os.version"="20.04" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should probably be 22.04.
Suggested change
|
||||||
LABEL java="8, 11" | ||||||
LABEL node="16.20.2" | ||||||
LABEL maintainer="George Tay" | ||||||
|
||||||
WORKDIR /RepoSense | ||||||
|
||||||
# copy over all files | ||||||
COPY . . | ||||||
|
||||||
# allow gradlew to be executable | ||||||
RUN chmod +x gradlew | ||||||
|
||||||
# make the report directory | ||||||
RUN mkdir reports | ||||||
|
||||||
# test java 8 | ||||||
RUN export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 && \ | ||||||
update-java-alternatives --set /usr/lib/jvm/java-1.8.0-openjdk-amd64; | ||||||
RUN ./gradlew environmentalChecks | ||||||
RUN ./gradlew lintFrontend | ||||||
RUN ./gradlew clean | ||||||
RUN ./gradlew test | ||||||
RUN ./gradlew systemTest | ||||||
RUN ./gradlew checkstyleAll | ||||||
# RUN ./gradlew clean | ||||||
# RUN ./gradlew frontendTest -Pci | ||||||
RUN ./gradlew coverage | ||||||
RUN cp -rf ./build/reports/jacoco/coverage reports/ | ||||||
RUN mv -f reports/coverage reports/java8 | ||||||
|
||||||
# test java 11 | ||||||
RUN export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 && \ | ||||||
update-java-alternatives --set /usr/lib/jvm/java-1.11.0-openjdk-amd64; | ||||||
RUN ./gradlew environmentalChecks | ||||||
RUN ./gradlew lintFrontend | ||||||
RUN ./gradlew clean | ||||||
RUN ./gradlew test | ||||||
RUN ./gradlew systemTest | ||||||
RUN ./gradlew checkstyleAll | ||||||
# RUN ./gradlew clean | ||||||
# RUN ./gradlew frontendTest -Pci | ||||||
RUN ./gradlew coverage | ||||||
RUN cp -rf ./build/reports/jacoco/coverage reports/ | ||||||
RUN mv -f reports/coverage reports/java | ||||||
|
||||||
# export reports | ||||||
FROM scratch AS report-exporter | ||||||
COPY --from=setup-env RepoSense/reports /reports |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be re-added?