Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into early-abort-support
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell committed Sep 14, 2023
2 parents d8e94d6 + 5062cc9 commit 8fd8707
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 87 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/act.yaml → .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Arcaflow Container Toolkit
name: Arcaflow CI Workflow
on:
push:
branches:
Expand All @@ -12,9 +12,13 @@ jobs:
with:
image_name: ${{ github.event.repository.name }}
image_tag: 'latest'
github_username: ${{ github.actor }}
github_namespace: ${{ github.repository_owner }}
secrets:
QUAY_NAMESPACE: ${{ secrets.QUAY_NAMESPACE }}
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

docsgen:
needs: act
uses: arcalot/arcaflow-docsgen/.github/workflows/reusable_workflow.yaml@main
with:
plugin_path: "arcaflow_plugin_wait/wait_plugin.py"
64 changes: 43 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
FROM quay.io/centos/centos:stream8

RUN dnf -y module install python39 && dnf --setopt=tsflags=nodocs -y install python39 python39-pip && dnf clean all
RUN mkdir /app
# this is to satisfy arcaflow-plugin-image-builder but the local license file is the same.
ADD https://raw.githubusercontent.com/arcalot/arcaflow-plugin-template-python/main/LICENSE /app/
ADD README.md /app/
ADD wait_plugin.py /app/
ADD tests/test_wait_plugin.py /app/
ADD poetry.lock pyproject.toml /app/
WORKDIR /app

RUN pip3 install poetry
RUN poetry config virtualenvs.create false
RUN poetry install
RUN python3 -m coverage run test_wait_plugin.py
RUN python3 -m coverage html -d /htmlcov --omit=/usr/local/*

VOLUME /config

ENTRYPOINT ["python3", "/app/wait_plugin.py"]
# Package path for this plugin module relative to the repo root
ARG package=arcaflow_plugin_wait

# STAGE 1 -- Build module dependencies and run tests
# The 'poetry' and 'coverage' modules are installed and verson-controlled in the
# quay.io/arcalot/arcaflow-plugin-baseimage-python-buildbase image to limit drift
FROM quay.io/arcalot/arcaflow-plugin-baseimage-python-buildbase:0.2.0@sha256:7b72424c08c51d1bb6215fac0e002fd9d406b6321dcd74233ea53ec653280be8 as build
ARG package

COPY poetry.lock /app/
COPY pyproject.toml /app/

# Convert the dependencies from poetry to a static requirements.txt file
RUN python -m poetry install --without dev --no-root \
&& python -m poetry export -f requirements.txt --output requirements.txt --without-hashes

COPY ${package}/ /app/${package}
COPY tests /app/${package}/tests

ENV PYTHONPATH /app/${package}
WORKDIR /app/${package}

# Run tests and return coverage analysis
RUN python -m coverage run tests/test_${package}.py \
&& python -m coverage html -d /htmlcov --omit=/usr/local/*


# STAGE 2 -- Build final plugin image
FROM quay.io/arcalot/arcaflow-plugin-baseimage-python-osbase:0.2.0@sha256:a57baf7714d13b4fb0a01551990eed927b1f1251cd502ad01bcb05ffeeff31d8
ARG package

COPY --from=build /app/requirements.txt /app/
COPY --from=build /htmlcov /htmlcov/
COPY LICENSE /app/
COPY README.md /app/
COPY ${package}/ /app/${package}

# Install all plugin dependencies from the generated requirements.txt file
RUN python -m pip install -r requirements.txt

WORKDIR /app/${package}

ENTRYPOINT ["python", "wait_plugin.py"]
CMD []

LABEL org.opencontainers.image.source="https://github.com/arcalot/arcaflow-plugin-wait"
Expand Down
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,60 @@ poetry install
python -m coverage run -a -m unittest discover -s tests -v
python -m coverage html
```
# Autogenerated Input/Output Documentation by Arcaflow-Docsgen Below

<!-- Autogenerated documentation by arcaflow-docsgen -->
## Wait (`wait`)

Waits for the given amount of time

### Input

<table><tbody>
<tr><th>Type:</th><td><code>scope</code></td><tr><th>Root object:</th><td>InputParams</td></tr>
<tr><th>Properties</th><td><details><summary>seconds (<code>float</code>)</summary>
<table><tbody><tr><th>Name:</th><td>seconds</td></tr><tr><th>Description:</th><td>number of seconds to wait as a floating point number for subsecond precision.</td></tr><tr><th>Required:</th><td>Yes</td></tr><tr><th>Type:</th><td><code>float</code></td><tr><th>Minimum:</th><td>0</td></tr>
</tbody></table>
</details></td></tr>
<tr><td colspan="2"><details><summary><strong>Objects</strong></summary><details><summary>InputParams (<code>object</code>)</summary>
<table><tbody><tr><th>Type:</th><td><code>object</code></td><tr><th>Properties</th><td><details><summary>seconds (<code>float</code>)</summary>
<table><tbody><tr><th>Name:</th><td>seconds</td></tr><tr><th>Description:</th><td>number of seconds to wait as a floating point number for subsecond precision.</td></tr><tr><th>Required:</th><td>Yes</td></tr><tr><th>Type:</th><td><code>float</code></td><tr><th>Minimum:</th><td>0</td></tr>
</tbody></table>
</details></td></tr>
</tbody></table>
</details></details></td></tr>
</tbody></table>

### Outputs


#### error

<table><tbody>
<tr><th>Type:</th><td><code>scope</code></td><tr><th>Root object:</th><td>ErrorOutput</td></tr>
<tr><th>Properties</th><td><details><summary>error (<code>string</code>)</summary>
<table><tbody><tr><th>Required:</th><td>Yes</td></tr><tr><th>Type:</th><td><code>string</code></td></tbody></table>
</details></td></tr>
<tr><td colspan="2"><details><summary><strong>Objects</strong></summary><details><summary>ErrorOutput (<code>object</code>)</summary>
<table><tbody><tr><th>Type:</th><td><code>object</code></td><tr><th>Properties</th><td><details><summary>error (<code>string</code>)</summary>
<table><tbody><tr><th>Required:</th><td>Yes</td></tr><tr><th>Type:</th><td><code>string</code></td></tbody></table>
</details></td></tr>
</tbody></table>
</details></details></td></tr>
</tbody></table>

#### success

<table><tbody>
<tr><th>Type:</th><td><code>scope</code></td><tr><th>Root object:</th><td>SuccessOutput</td></tr>
<tr><th>Properties</th><td><details><summary>message (<code>string</code>)</summary>
<table><tbody><tr><th>Required:</th><td>Yes</td></tr><tr><th>Type:</th><td><code>string</code></td></tbody></table>
</details></td></tr>
<tr><td colspan="2"><details><summary><strong>Objects</strong></summary><details><summary>SuccessOutput (<code>object</code>)</summary>
<table><tbody><tr><th>Type:</th><td><code>object</code></td><tr><th>Properties</th><td><details><summary>message (<code>string</code>)</summary>
<table><tbody><tr><th>Required:</th><td>Yes</td></tr><tr><th>Type:</th><td><code>string</code></td></tbody></table>
</details></td></tr>
</tbody></table>
</details></details></td></tr>
</tbody></table>
<!-- End of autogenerated documentation -->
File renamed without changes.
Loading

0 comments on commit 8fd8707

Please sign in to comment.