Skip to content

Commit

Permalink
enable package publish
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-rocket committed Jul 23, 2024
1 parent 00af005 commit b156485
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 41 deletions.
70 changes: 31 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# GitHub Actions configuration **EXAMPLE**,
# MODIFY IT ACCORDING TO YOUR NEEDS!
# Reference: https://docs.github.com/en/actions

name: tests
name: build

on:
push:
Expand Down Expand Up @@ -60,8 +56,7 @@ jobs:
strategy:
matrix:
python:
- "3.9" # oldest Python supported by PSF
- "3.11" # newest Python that is stable
- "3.11"
platform:
- ubuntu-latest
# - macos-latest
Expand Down Expand Up @@ -94,35 +89,32 @@ jobs:
flag-name: ${{ matrix.platform }} - py${{ matrix.python }}
parallel: true

# finalize:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Finalize coverage report
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true
#
# publish:
# needs: finalize
# if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
# runs-on: ubuntu-latest
# permissions:
# contents: write
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with: {python-version: "3.11"}
# - name: Retrieve pre-built distribution files
# uses: actions/download-artifact@v4
# with: {name: python-distribution-files, path: dist/}
# - name: Publish Package
# env:
# # TODO: Set your PYPI_TOKEN as a secret using GitHub UI
# # - https://pypi.org/help/#apitoken
# # - https://docs.github.com/en/actions/security-guides/encrypted-secrets
# TWINE_REPOSITORY: pypi
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: pipx run tox -e publish
finalize:
needs: test
runs-on: ubuntu-latest
steps:
- name: Finalize coverage report
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true

publish:
needs: finalize
if: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: {python-version: "3.11"}
- name: Retrieve pre-built distribution files
uses: actions/download-artifact@v4
with: {name: python-distribution-files, path: dist/}
- name: Publish Package
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: pipx run tox -e publish
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
-->

[![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)](https://pyscaffold.org/)
[![Coveralls](https://img.shields.io/coveralls/github/imubit/k8s-job-scheduler/main.svg)](https://coveralls.io/r/imubit/k8s-job-scheduler)
[![PyPI-Server](https://img.shields.io/pypi/v/k8s-job-scheduler.svg)](https://pypi.org/project/k8s-job-scheduler/)


# k8s-job-scheduler

A package for managing Kubernetes jobs and cron jobs from Python. It allows running CLI scripts and Python function within native Kubernetes job engine.
A package for managing Kubernetes jobs and cron jobs from Python. It allows running CLI scripts and Python functions within native Kubernetes job engine.
No need to package separate Docker images with functions to be executed - the package can remotely "inject" the Python function using `dill` into publicly available Docker images.

## Installation

Expand Down
2 changes: 1 addition & 1 deletion tests/test_job_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def test_instant_python_job(jobman):
assert job_name.startswith("kjs-inst-job-")
assert jobman.list_jobs() == [job_name]

time.sleep(10)
time.sleep(15)

status, _ = jobman.job_status(job_name)
assert status == "SUCCEEDED"
Expand Down

0 comments on commit b156485

Please sign in to comment.