Skip to content
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

chore: Reorganise workflow yamls #267

Merged
merged 29 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4af16d0
Rename argo workflow files
Sep 9, 2024
b7f9d12
Delete example-feature argo-workflows folders
Sep 9, 2024
379b485
Re-organise workflow docker containers into their own folder
Sep 9, 2024
9976d44
Fix up the "defined in" metadata in workflows that were renamed
Sep 9, 2024
2e3f3fa
Add titles to argo workflow templates
Sep 9, 2024
bc1e7cd
Fix outdated docstring comment
Sep 9, 2024
bf9053a
Re-organise argo-workflow docs
Sep 9, 2024
677a207
Rename workflows->workflowtemplates to reflect the Kind of its contents
Sep 10, 2024
5504ea9
Move dnsmasq container to subdirectory
Sep 10, 2024
d6e2575
Move ironiic-nautobot-client container to subdirectory
Sep 10, 2024
7309253
Move ironic and neutron containers to subdirectories
Sep 10, 2024
251f058
Move argo-workflow containers to central containers directory
Sep 10, 2024
f8efe8c
Fix up precommit and github jobs paths for YAML tempalte changes
Sep 10, 2024
ada2611
Organise the eventsource nautobot-webhook
Sep 10, 2024
86d4f25
Merge the workflowtemplates into one place
Sep 10, 2024
3b6db73
Update appsets configuration to reflect new path to workflows
Sep 10, 2024
0d5b18a
Update workflow descriptions to match new paths
Sep 10, 2024
804d000
Update yamllint to reflect changes to workflow paths
Sep 10, 2024
9fb99e3
Update pre-commit config to reflect changes to workflow paths
Sep 11, 2024
d2d6f33
Update workflows.yaml to reflect new workflow paths
Sep 11, 2024
c51bc98
Fix doc link to reflect new path to workflows
Sep 11, 2024
550ea9a
Fix up Dockerfiles to reflect change to container directory structure
Sep 11, 2024
055ae0d
Break workflow role into one yaml file per object for yamllint
Sep 11, 2024
bed01ff
Update docs paths to refelct changes to workflow directory structure
Sep 11, 2024
286e942
Use dynamic github repository name instead of hardcoding rackerlabs
Sep 11, 2024
e1c2647
Fix dnsmasq container build to reflect changed path of Dockerfile
Sep 11, 2024
92e4c91
Break into one object per yaml file to appease yamllint
Sep 11, 2024
51a3372
Fix broken dockerfile path in container build script
Sep 11, 2024
f8dc624
Have yamllint allow templates without annotations
Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 20 additions & 18 deletions .github/workflows/build-container-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@ on:
workflow_dispatch:
pull_request:
paths:
- 'argo-workflows/*/containers/*'
- 'argo-workflows/*/code/**'
- '!argo-workflows/example-feature/**'
- "containers/argo_utils/**"
- "containers/obm-utils/**"
- "containers/python311_alpine/**"
- "containers/python312_alpine/**"
push:
branches:
- main
paths:
- 'argo-workflows/*/containers/*'
- 'argo-workflows/*/code/**'
- '!argo-workflows/example-feature/**'
- "containers/argo_utils/**"
- "containers/obm-utils/**"
- "containers/python311_alpine/**"
- "containers/python312_alpine/**"

# bump container versions here, they will be populated to tags and labels
env:
Expand Down Expand Up @@ -46,43 +48,43 @@ jobs:
- name: Build and deploy Python 3.11 image
uses: docker/build-push-action@v5
with:
context: argo-workflows/generic/
file: argo-workflows/generic/containers/Dockerfile.python311_alpine
context: containers/python311_alpine/
file: containers/python311_alpine/Dockerfile.python311_alpine
# push for all main branch commits
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.11.8-alpine3.19:${{ env.VERSION_PYTHON311 }}
tags: ghcr.io/${{ github.repository }}/argo-python3.11.8-alpine3.19:latest,ghcr.io/${{ github.repository }}/argo-python3.11.8-alpine3.19:${{ env.VERSION_PYTHON311 }}
labels: |
org.opencontainers.image.version=${{ env.VERSION_PYTHON311 }}

- name: Build and deploy Python 3.12 image
uses: docker/build-push-action@v5
with:
context: argo-workflows/generic/
file: argo-workflows/generic/containers/Dockerfile.python312_alpine
context: containers/python312_alpine/
file: containers/python312_alpine/Dockerfile.python312_alpine
# push for all main branch commits
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:latest,ghcr.io/rackerlabs/understack/argo-python3.12.2-alpine3.19:${{ env.VERSION_PYTHON312 }}
tags: ghcr.io/${{ github.repository }}/argo-python3.12.2-alpine3.19:latest,ghcr.io/${{ github.repository }}/argo-python3.12.2-alpine3.19:${{ env.VERSION_PYTHON312 }}
labels: |
org.opencontainers.image.version=${{ env.VERSION_PYTHON312 }}

- name: Build and deploy Argo Utils image
uses: docker/build-push-action@v5
with:
context: argo-workflows/generic/
file: argo-workflows/generic/containers/Dockerfile.argo_utils
context: containers/argo_utils/
file: containers/argo_utils/Dockerfile.argo_utils
# push for all main branch commits
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-utils-python3.11.8:${{ env.VERSION_ARGO_UTILS }}
tags: ghcr.io/${{ github.repository }}/argo-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-utils-python3.11.8:${{ env.VERSION_ARGO_UTILS }}
labels: |
org.opencontainers.image.version=${{ env.VERSION_ARGO_UTILS }}

- name: Build and deploy OBM Utils image
uses: docker/build-push-action@v5
with:
context: argo-workflows/obm-utils/
file: argo-workflows/obm-utils/containers/Dockerfile.obm_utils
context: containers/obm-utils/
file: containers/obm-utils/Dockerfile.obm_utils
# push for all main branch commits
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:latest,ghcr.io/rackerlabs/understack/argo-obm-utils-python3.11.8:${{ env.VERSION_OBM_UTILS }}
tags: ghcr.io/${{ github.repository }}/argo-obm-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-obm-utils-python3.11.8:${{ env.VERSION_OBM_UTILS }}
labels: |
org.opencontainers.image.version=${{ env.VERSION_OBM_UTILS }}
11 changes: 6 additions & 5 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
# that are arch specific so populate them at the index as well.
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index

- name: build and deploy container image to registry
- name: build and deploy openstack container image to registry
uses: docker/build-push-action@v5
with:
file: containers/Dockerfile.${{ matrix.project }}
file: containers/${{ matrix.project }}/Dockerfile.${{ matrix.project }}
build-args: OPENSTACK_VERSION=${{ matrix.openstack }}
pull: true # ensure we always have an up to date source
push: true
Expand Down Expand Up @@ -98,8 +98,9 @@ jobs:
- name: build and deploy dnsmasq container to registry
uses: docker/build-push-action@v5
with:
file: containers/Dockerfile.dnsmasq
push: true
context: "{{defaultContext}}:containers/dnsmasq"
file: Dockerfile.dnsmasq
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand Down Expand Up @@ -142,7 +143,7 @@ jobs:
- name: build and deploy container image to registry
uses: docker/build-push-action@v5
with:
file: containers/Dockerfile.${{ matrix.container.name }}
file: containers/${{ matrix.container.name }}/Dockerfile.${{ matrix.container.name }}
pull: true # ensure we always have an up to date source
push: true
tags: ${{ steps.meta.outputs.tags }}
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ jobs:
- uses: actions/checkout@v4
- uses: thiagodnf/[email protected]
with:
jsonSchemaFile: argo-workflows/.workflow_with_description.schema.json
jsonSchemaFile: workflows/.workflow_with_description.schema.json
yamlFiles: |
argo-workflows/**/workflowtemplates/*.y*ml
argo-workflows/**/sensors/*.y*ml
argo-workflows/**/workflows/*.y*ml
apps/understack-workflows/workflows/workflowtemplates/*.y*ml
workflows/argo-events/sensors/*.y*ml
workflows/argo-events/workflowtemplates/*.y*ml

shellcheck:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ repos:
args:
- --schemafile
- https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json
files: "argo-workflows/.*/(workflows|workflowtemplates)/.*.(yml|yaml)$"
files: "workflows/argo-events/(sensors|workflowtemplates)/.*.(yml|yaml)$"
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.37.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ $(ACTIVATE): requirements-docs.txt

docs/workflows: $(ACTIVATE)
@mkdir -p docs/workflows
@$(PYTHON) scripts/argo-workflows-to-mkdocs.py argo-workflows docs/workflows
@$(PYTHON) scripts/argo-workflows-to-mkdocs.py workflows docs/workflows

.PHONY: docs
docs: $(ACTIVATE) docs/workflows ## Builds the documentation
Expand Down
2 changes: 1 addition & 1 deletion apps/appsets/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ spec:
source:
repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
path: 'apps/understack-workflows'
path: 'workflows'
selector:
# by setting the key in the elements 'skipComponent' to 'true' it will skip installing it
# ArgoCD's templating operates with strings so it's the string "true"
Expand Down
5 changes: 2 additions & 3 deletions apps/appsets/workflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@ spec:
sources:
- repoURL: '{{index .metadata.annotations "uc_repo_git_url"}}'
targetRevision: '{{index .metadata.annotations "uc_repo_ref"}}'
path: 'argo-workflows'
path: 'workflows/argo-events'
directory:
recurse: true
include: '{generic/deps/*.yaml,shared-sensors/*.yaml,*/sensors/*.yaml,*/workflowtemplates/*.yaml}'
exclude: '{example-feature/*,*/*/*example*}'
include: '{roles/*.yaml,rolebindings/*.yaml,secrets/*.yaml,sensors/*yaml,eventsources/*.yaml,workflowtemplates/*.yaml}'
- repoURL: '{{index .metadata.annotations "uc_deploy_git_url"}}'
targetRevision: '{{index .metadata.annotations "uc_deploy_ref"}}'
path: 'argo-workflows'
Expand Down
41 changes: 0 additions & 41 deletions apps/understack-workflows/eventsource-openstack/argo-rabbitmq.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions apps/understack-workflows/eventsource-openstack/kustomization.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions apps/understack-workflows/workflows/kustomization.yaml

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.

This file was deleted.

This file was deleted.

45 changes: 0 additions & 45 deletions components/argo-events/webhook-sensor.yaml

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN apt-get -y build-dep dnsmasq
RUN apt-get -y source dnsmasq
WORKDIR /src/dnsmasq-2.89
RUN mkdir -p debian/patches
COPY containers/dnsmasq/dhcp-allowed-srvids.patch /src/dnsmasq-2.89/debian/patches/
COPY dnsmasq/dhcp-allowed-srvids.patch /src/dnsmasq-2.89/debian/patches/
RUN echo dhcp-allowed-srvids.patch > debian/patches/series
RUN quilt push -a
RUN dch -v 2.89-2 "patched for dhcp-allowed-srvids"
Expand All @@ -42,10 +42,10 @@ RUN apt-get update && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/*.deb

COPY containers/common/helpers.sh /helpers.sh
COPY containers/dnsmasq/entry-point.sh /entry-point.sh
COPY common/helpers.sh /helpers.sh
COPY dnsmasq/entry-point.sh /entry-point.sh
RUN chmod +x /entry-point.sh
COPY containers/dnsmasq/dnsmasq.conf.j2 /etc/dnsmasq.conf.j2
COPY dnsmasq/dnsmasq.conf.j2 /etc/dnsmasq.conf.j2
# let our entry point write out the script
RUN ln -sf /etc/dnsmasq.d/dnsmasq.conf /etc/dnsmasq.conf

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ARG APP_GROUP=appgroup
ARG APP_USER_UID=1000
ARG APP_GROUP_GID=1000

COPY --chown=${APP_USER}:${APP_GROUP} containers/requirements.txt /app
COPY --chown=${APP_USER}:${APP_GROUP} requirements.txt /app
RUN --mount=type=cache,target=/root/.cache/.pip pip install --no-cache-dir -r /app/requirements.txt

FROM ${BASE} as prod
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/component-argo-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ the Pod's uid can be passed via the `KUBERNETES_POD_UID` environment variable. T
completion of the Workflow `.spec.podGC.strategy` can be set to `OnWorkflowCompletion`.

An example WorkflowTemplate demonstrating argo-python usage can be found
[here](https://github.com/rackerlabs/understack/blob/main/argo-workflows/generic/workflowtemplates/get-obm-creds.yaml).
[here](https://github.com/rackerlabs/understack/blob/main/workflows/argo-events/workflowtemplates/get-obm-creds.yaml).

### Argo CLI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def argument_parser():


def main():
"""Updates Interface status in Nautobot triggers Undersync.
"""Updates Interface Status in Nautobot and triggers Undersync.

Updates Nautobot Interfaces's status field and follows with request to
Undersync service, requesting sync for all of the uplink_switches that the
device is connected to.
Updates Nautobot Device Interface status field and follows with
request to Undersync service, requesting sync for all of the
uplink_switches that the device is connected to.
"""
args = argument_parser().parse_args()

Expand Down
Loading
Loading