-
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.
- Loading branch information
1 parent
21cf177
commit 459630c
Showing
18 changed files
with
2,033 additions
and
44 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,15 @@ | ||
name: add-issues-to-octue-board | ||
|
||
on: | ||
issues: | ||
types: [opened, reopened, transferred] | ||
|
||
jobs: | ||
add-issues-to-octue-board: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Add to Board | ||
uses: actions/add-to-project@v0.5.0 | ||
with: | ||
project-url: https://github.com/orgs/octue/projects/22 | ||
github-token: ${{ secrets.OCTUE_PROJECT_ISSUES_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
# Runner size impacts CodeQL analysis time. To learn more, please see: | ||
# - https://gh.io/recommended-hardware-resources-for-running-codeql | ||
# - https://gh.io/supported-runners-and-hardware-resources | ||
# - https://gh.io/using-larger-runners | ||
# Consider using larger runners for possible analysis time improvements. | ||
runs-on: 'ubuntu-latest' | ||
|
||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
|
||
# only required for workflows in private repositories | ||
actions: read | ||
contents: read | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'python' ] | ||
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] | ||
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both | ||
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both | ||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v3 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
|
||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs | ||
# queries: security-extended,security-and-quality | ||
|
||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v3 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | ||
|
||
# If the Autobuild fails above, remove it and uncomment the following three lines. | ||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. | ||
|
||
# - run: | | ||
# echo "Run, Build Application using script" | ||
# ./location_of_script_within_repo/buildscript.sh | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v3 | ||
with: | ||
category: "/language:${{matrix.language}}" |
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,34 @@ | ||
name: Release the package on merge into main | ||
|
||
# Only trigger when a pull request into main branch is closed. | ||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
# This job will only run if the PR has been merged (and not closed without merging). | ||
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1.3.2 | ||
|
||
- name: Get package version | ||
id: get-package-version | ||
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT | ||
|
||
- name: Create Release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create your own. | ||
with: | ||
tag_name: ${{ steps.get-package-version.outputs.PACKAGE_VERSION }} | ||
release_name: ${{ github.event.pull_request.title }} | ||
body: ${{ github.event.pull_request.body }} | ||
draft: false | ||
prerelease: false |
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,14 @@ | ||
name: semantic | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
check-semantic-version: | ||
if: "!contains(github.event.head_commit.message, 'skipci')" | ||
uses: octue/workflows/.github/workflows/check-semantic-version.yml@main | ||
with: | ||
path: pyproject.toml | ||
breaking_change_indicated_by: minor |
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,18 @@ | ||
# This workflow updates the pull request description with an auto-generated section containing the categorised commit | ||
# message headers of the commits since the last pull request merged into main. The auto generated section is enveloped | ||
# between two comments: "<!--- START AUTOGENERATED NOTES --->" and "<!--- END AUTOGENERATED NOTES --->". Anything | ||
# outside these in the description is left untouched. Auto-generated updates can be skipped for a commit if | ||
# "<!--- SKIP AUTOGENERATED NOTES --->" is added to the pull request description. | ||
|
||
name: update-pull-request | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
description: | ||
uses: octue/workflows/.github/workflows/generate-pull-request-description.yml@main | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
permissions: | ||
contents: read | ||
pull-requests: write |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
exclude: "build|.git/|.tox|dist|octue.egg-info" | ||
default_stages: [commit] | ||
fail_fast: true | ||
default_language_version: | ||
python: python3 # force all unspecified python hooks to run python3 | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.6.0 | ||
hooks: | ||
- id: black | ||
args: ["--line-length", "120"] | ||
|
||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
language_version: python3 | ||
additional_dependencies: | ||
- "pep8-naming" | ||
args: | ||
- --ignore-names=setUp,tearDown,setUpClass,tearDownClass,asyncSetUp,asyncTearDown,setUpTestData,failureException,longMessage,maxDiff,startTestRun,stopTestRun | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: v2.7.1 | ||
hooks: | ||
- id: prettier | ||
|
||
- repo: https://github.com/pycqa/pydocstyle | ||
rev: 6.1.1 | ||
hooks: | ||
- id: pydocstyle | ||
|
||
- repo: https://github.com/windpioneers/pre-commit-hooks | ||
rev: 0.0.5 | ||
hooks: | ||
- id: check-branch-name | ||
args: | ||
- "^main$" | ||
- "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" | ||
|
||
- repo: https://github.com/octue/conventional-commits | ||
rev: 0.9.0 | ||
hooks: | ||
- id: check-commit-message-is-conventional | ||
stages: [commit-msg] |
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 @@ | ||
{ | ||
"output_location": "gs://octue-sdk-python-test-bucket/example-service-kueue/outputs" | ||
} |
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,28 @@ | ||
import logging | ||
import os | ||
import tempfile | ||
import time | ||
|
||
from octue.resources import Datafile, Dataset | ||
|
||
from example_service_kueue.submodule import do_something | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def run(analysis): | ||
logger.info("Started example analysis.") | ||
do_something() | ||
time.sleep(2) | ||
analysis.output_values = [1, 2, 3, 4, 5] | ||
|
||
with tempfile.TemporaryDirectory() as temporary_directory: | ||
|
||
with Datafile(os.path.join(temporary_directory, "output.dat"), mode="w") as (datafile, f): | ||
f.write("This is some example service output.") | ||
|
||
analysis.output_manifest.datasets["example_dataset"] = Dataset(path=temporary_directory, files={datafile}) | ||
analysis.finalise(upload_output_datasets_to=analysis.output_location) | ||
|
||
logger.info("Finished example analysis.") |
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,8 @@ | ||
import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def do_something(): | ||
logger.info("Submodules are included in logging.") |
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,6 @@ | ||
services: | ||
- namespace: octue | ||
name: example-service-kueue | ||
app_source_path: example_service_kueue | ||
app_configuration_path: app_configuration.json | ||
event_store_table_id: octue_sdk_python_test_dataset.service-events |
Oops, something went wrong.