This repository has been archived by the owner on Apr 25, 2024. It is now read-only.
-
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 #4 from telekom/support/ubuntu2204
Added new templating to cope with the behaviour change in ubuntu 22.04
- Loading branch information
Showing
8 changed files
with
162 additions
and
38 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,108 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Python PreRelease | ||
on: | ||
push: | ||
tags: | ||
# only run the release pipeline on semver tags | ||
- '[0-9]+.[0-9]+.[0-9]+-rc\.[0-9]+' | ||
|
||
env: | ||
TAG_NAME: ${{ github.ref_name }} | ||
LINUX_AMD64_BINARY: "netplanner-linux-amd64-${{ github.ref_name }}" | ||
|
||
jobs: | ||
prerelease: | ||
runs-on: ubuntu-20.04 # use an ancient release for glibc compatibility. | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: ["3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
which strip | ||
python -m pip install --upgrade pip poetry | ||
poetry config virtualenvs.in-project true | ||
poetry --version | ||
poetry install --no-root | ||
- name: Build package | ||
run: | | ||
poetry build | ||
- name: Install Package | ||
run: | | ||
poetry run python -m pip install dist/*.whl | ||
echo "PROJECT_VERSION=$(poetry run python -m netplanner --version)" >> $GITHUB_ENV | ||
TAG_VERSION_RAW="${{ env.TAG_NAME }}" | ||
TAG_VERSION_WITHOUT_DOT="${TAG_VERSION_RAW%.*}${TAG_VERSION_RAW##*.}" # replace last dot | ||
TAG_VERSION_WITHOUT_MINUS=${TAG_VERSION_WITHOUT_DOT//-} # replace all occurences of minus | ||
echo "TAG_VERSION=${TAG_VERSION_WITHOUT_MINUS}" >> $GITHUB_ENV | ||
poetry run python -m pip uninstall --yes dist/*.whl | ||
id: version | ||
- name: Break on version mismatch | ||
if: ${{ env.TAG_VERSION != env.PROJECT_VERSION }} | ||
run: | | ||
echo "::error::We found a version mismatch GIT:[${{ env.TAG_VERSION }}] != PROJECT:[${{ env.PROJECT_VERSION }}]" | ||
exit 1 | ||
- name: Lint with black | ||
run: | | ||
poetry run black -t py310 --check . | ||
- name: Type Lint with mypy | ||
run: | | ||
poetry run mypy . | ||
- name: Build package | ||
run: | | ||
poetry build | ||
- name: Build dynamically linked binary | ||
run: | | ||
poetry run pyoxidizer build --release | ||
mkdir -p bin/ | ||
cp build/x86_64-unknown-linux-gnu/release/install/netplanner "bin/${LINUX_AMD64_BINARY}" | ||
chmod 0644 "bin/${LINUX_AMD64_BINARY}" | ||
strip "bin/${LINUX_AMD64_BINARY}" | ||
cd bin/ && sha256sum "${LINUX_AMD64_BINARY}" > "${LINUX_AMD64_BINARY}.sha256" && cd .. | ||
- name: E2E Tests | ||
run: | | ||
chmod 0755 "bin/${LINUX_AMD64_BINARY}" | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/worker-config-old.yaml --output /run/systemd/networkd/worker-old configure | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/worker-config-new.yaml --output /run/systemd/networkd/worker-new configure | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/master-config-old.yaml --output /run/systemd/networkd/master-old configure | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/master-config-new.yaml --output /run/systemd/networkd/master-new configure | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/veth-trial.yaml --output /run/systemd/networkd/veth-trial configure | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/5g-worker --output /run/systemd/networkd/folder/5g-worker configure | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/5g-worker.yaml --output /run/systemd/networkd/5g-worker configure | ||
# enable the netplan apply command | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/vm-config --output /run/systemd/networkd/folder/vm-config apply | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/vm-config.yaml --output /run/systemd/networkd/vm-config apply | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/vm-config-v6.yaml --output /run/systemd/networkd/vm-config-v6 apply | ||
# this should fail | ||
bin/${LINUX_AMD64_BINARY} --debug --local --only-networkd --config examples/empty --output /run/systemd/networkd/empty configure || true | ||
- name: Unit Tests | ||
run: | | ||
echo "This should later run the unit tests." | ||
- name: Release on GitHub | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: false | ||
prerelease: true | ||
generate_release_notes: true | ||
fail_on_unmatched_files: true | ||
files: | | ||
./bin/${{ env.LINUX_AMD64_BINARY }} | ||
./bin/${{ env.LINUX_AMD64_BINARY }}.sha256 | ||
./dist/* | ||
./build/x86_64-unknown-linux-gnu/release/install/COPYING.txt | ||
- name: Release on PyPi | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
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
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
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
8 changes: 7 additions & 1 deletion
8
netplanner/providers/networkd/templates/network_includes/link.j2
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "netplanner" | ||
version = "0.14.6" | ||
version = "0.14.7-rc.5" | ||
description = "Mimir the Netplanner is the ground of all network wisdöm" | ||
authors = ["Marcel Fest <[email protected]>", "Christopher Dziomba <[email protected]>"] | ||
license = "GPL-3.0-only" | ||
|