-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from nuvlaedge/tasklist_issue_3335
feat: Add containerised version of the validator
- Loading branch information
Showing
13 changed files
with
638 additions
and
493 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "1.3.18" | ||
} |
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,40 @@ | ||
{ | ||
"release-type": "python", | ||
"include-v-in-tag": false, | ||
"changelog-sections": [ | ||
{ "type": "feat", "section": "Features" }, | ||
{ "type": "feature", "section": "Features" }, | ||
{ "type": "fix", "section": "Bug Fixes" }, | ||
{ "type": "perf", "section": "Performance Improvements" }, | ||
{ "type": "revert", "section": "Reverts" }, | ||
{ "type": "deps", "section": "Dependencies","hidden": false }, | ||
{ "type": "docs", "section": "Documentation", "hidden": false }, | ||
{ "type": "style", "section": "Styles", "hidden": true }, | ||
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true }, | ||
{ "type": "refactor", "section": "Code Refactoring", "hidden": true }, | ||
{ "type": "test", "section": "Tests", "hidden": true }, | ||
{ "type": "build", "section": "Build System", "hidden": true }, | ||
{ "type": "ci", "section": "Continuous Integration", "hidden": false } | ||
], | ||
"packages": { | ||
".": { | ||
"release-type": "python", | ||
"include-v-in-tag": false, | ||
"changelog-sections": [ | ||
{ "type": "feat", "section": "Features" }, | ||
{ "type": "feature", "section": "Features" }, | ||
{ "type": "fix", "section": "Bug Fixes" }, | ||
{ "type": "perf", "section": "Performance Improvements", "hidden": false}, | ||
{ "type": "revert", "section": "Reverts" }, | ||
{ "type": "deps", "section": "Dependencies","hidden": false }, | ||
{ "type": "docs", "section": "Documentation", "hidden": false }, | ||
{ "type": "style", "section": "Styles", "hidden": true }, | ||
{ "type": "chore", "section": "Miscellaneous Chores", "hidden": true }, | ||
{ "type": "refactor", "section": "Code Refactoring", "hidden": true }, | ||
{ "type": "test", "section": "Tests", "hidden": true }, | ||
{ "type": "build", "section": "Build System", "hidden": true }, | ||
{ "type": "ci", "section": "Continuous Integration", "hidden": false } | ||
] | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,110 @@ | ||
name: "Release Please" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- release/* | ||
|
||
jobs: | ||
trigger-release: | ||
runs-on: ubuntu-latest | ||
needs: run-validator | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
major: ${{ steps.release.outputs.major }} | ||
minor: ${{ steps.release.outputs.minor }} | ||
patch: ${{ steps.release.outputs.patch }} | ||
tag_name: ${{ steps.release.outputs.tag_name }} | ||
|
||
steps: | ||
- id: release | ||
uses: googleapis/release-please-action@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
target-branch: ${{ github.ref_name }} | ||
config-file: .github/release-please-config.json | ||
manifest-file: .github/.release-please-manifest.json | ||
|
||
build-wheel: | ||
runs-on: ubuntu-latest | ||
needs: trigger-release | ||
if: needs.trigger-release.outputs.release_created | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: SetUp python interpreter | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Load cached poetry | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.local | ||
key: dotlocal-${{ runner.os }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Build library | ||
run: | | ||
poetry build --no-interaction --format=wheel | ||
- name: Upload wheel | ||
run: | | ||
echo "Uploading wheel to release ${{ needs.trigger-release.outputs.tag_name }}" | ||
gh release upload ${{ needs.trigger-release.outputs.tag_name }} dist/*.whl | ||
build-image: | ||
runs-on: ubuntu-latest | ||
needs: trigger-release | ||
if: needs.trigger-release.outputs.release_created | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# ------------------------------------------------ | ||
# Setup Docker ad Qemu | ||
# ------------------------------------------------ | ||
- name: SetUp QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: > | ||
nuvladev/${{ github.event.repository.name }}:latest, | ||
nuvladev/${{ github.event.repository.name }}:${{ needs.trigger-release.outputs.tag_name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
This file was deleted.
Oops, something went wrong.
Empty file.
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 @@ | ||
ARG ALPINE_MAJ_MIN_VERSION="3.20" | ||
ARG PYTHON_MAJ_MIN_VERSION="3.12" | ||
|
||
ARG BASE_IMAGE=python:${PYTHON_MAJ_MIN_VERSION}-alpine${ALPINE_MAJ_MIN_VERSION} | ||
|
||
# ------------------------------------------------------------------------ | ||
FROM ${BASE_IMAGE} AS poetry-image | ||
|
||
RUN pip install poetry | ||
|
||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
WORKDIR /app | ||
|
||
COPY --link poetry.lock pyproject.toml README.md /app/ | ||
|
||
RUN poetry install --no-root && rm -rf /tmp/poetry_cache | ||
|
||
|
||
FROM ${BASE_IMAGE} AS runtime | ||
|
||
ENV VIRTUAL_ENV=/app/.venv PATH="/app/.venv/bin:$PATH" | ||
|
||
COPY --from=poetry-image ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
COPY --link validation_framework/ ./validation_framework | ||
COPY --link conf/targets ./conf/targets | ||
|
||
ENTRYPOINT ["python", "-m", "validation_framework"] |
Oops, something went wrong.