Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 29c2f47

Browse files
authored
MRG: Merge pull request #12 from octue/devops/deploy-with-namespace
Clean up service
2 parents 2c16a04 + 741f485 commit 29c2f47

20 files changed

+1340
-142
lines changed

.dockerignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.github/workflows/python-ci.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
name: python-ci
22

3-
on: [push]
3+
on:
4+
push:
5+
branches-ignore:
6+
- main
47

58
jobs:
6-
79
check-semantic-version:
810
if: "!contains(github.event.head_commit.message, 'skipci')"
911
runs-on: ubuntu-latest
1012
steps:
11-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v3
1214
with:
1315
# Set fetch-depth to 0 to fetch all tags (necessary for git-mkver to determine the correct semantic version).
1416
fetch-depth: 0
15-
- uses: actions/setup-python@v2
16-
- name: Install git-mkver
17-
run: |
18-
curl -L https://github.com/idc101/git-mkver/releases/download/v1.2.1/git-mkver-linux-amd64-1.2.1.tar.gz \
19-
| tar xvz \
20-
&& sudo mv git-mkver /usr/local/bin
21-
- name: Install semantic version checker
22-
run: pip install git+https://github.com/octue/conventional-commits
23-
- name: Check version
24-
run: check-semantic-version setup.py
17+
18+
- uses: octue/[email protected]
19+
with:
20+
path: pyproject.toml
21+
breaking_change_indicated_by: minor

.github/workflows/release.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,22 @@ jobs:
1313
if: "github.event.pull_request.merged == true && !contains(github.event.pull_request.head.message, 'skipci')"
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v2
17-
- name: Get package version
18-
run: echo "PACKAGE_VERSION=$(python setup.py --version)" >> $GITHUB_ENV
19-
- name: Create Release
20-
uses: actions/create-release@v1
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create your own.
23-
with:
24-
tag_name: ${{ env.PACKAGE_VERSION }}
25-
release_name: ${{ github.event.pull_request.title }}
26-
body: ${{ github.event.pull_request.body }}
27-
draft: false
28-
prerelease: false
16+
- uses: actions/checkout@v2
17+
18+
- name: Install Poetry
19+
uses: snok/[email protected]
20+
21+
- name: Get package version
22+
id: get-package-version
23+
run: echo "PACKAGE_VERSION=$(poetry version -s)" >> $GITHUB_OUTPUT
24+
25+
- name: Create Release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, no need to create your own.
29+
with:
30+
tag_name: ${{ steps.get-package-version.outputs.PACKAGE_VERSION }}
31+
release_name: ${{ github.event.pull_request.title }}
32+
body: ${{ github.event.pull_request.body }}
33+
draft: false
34+
prerelease: false

.github/workflows/update-pull-request.yml

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,16 @@ jobs:
1717
if: "!contains(github.event.pull_request.body, '<!--- SKIP AUTOGENERATED NOTES --->')"
1818
runs-on: ubuntu-latest
1919
steps:
20-
- uses: actions/checkout@v2
21-
with:
22-
# Set fetch-depth to 0 to fetch all commit history (necessary for compiling pull request description).
23-
fetch-depth: 0
24-
- name: Install release note compiler
25-
run: pip install git+https://github.com/octue/conventional-commits
26-
- name: Compile new pull request description
27-
run: |
28-
echo 'PULL_REQUEST_NOTES<<EOF' >> $GITHUB_ENV
29-
echo "$(compile-release-notes PULL_REQUEST_START --pull-request-url=${{ github.event.pull_request.url }} --api-token=${{ secrets.GITHUB_TOKEN }})" >> $GITHUB_ENV
30-
echo EOF >> $GITHUB_ENV
31-
- name: Update pull request body
32-
uses: riskledger/update-pr-description@v2
33-
with:
34-
body: ${{ env.PULL_REQUEST_NOTES }}
35-
token: ${{ secrets.GITHUB_TOKEN }}
20+
- uses: actions/checkout@v3
21+
22+
- uses: octue/[email protected]
23+
id: pr-description
24+
with:
25+
pull_request_url: ${{ github.event.pull_request.url }}
26+
api_token: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Update pull request body
29+
uses: riskledger/update-pr-description@v2
30+
with:
31+
body: ${{ steps.pr-description.outputs.pull_request_description }}
32+
token: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
exclude: "build|.git/|.tox|dist|octue.egg-info"
2+
default_stages: [commit]
3+
fail_fast: true
4+
default_language_version:
5+
python: python3 # force all unspecified python hooks to run python3
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v4.3.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-yaml
13+
- id: check-added-large-files
14+
15+
- repo: https://github.com/PyCQA/isort
16+
rev: 5.10.1
17+
hooks:
18+
- id: isort
19+
20+
- repo: https://github.com/psf/black
21+
rev: 22.6.0
22+
hooks:
23+
- id: black
24+
args: ["--line-length", "120"]
25+
26+
- repo: https://github.com/pycqa/flake8
27+
rev: 6.0.0
28+
hooks:
29+
- id: flake8
30+
language_version: python3
31+
additional_dependencies:
32+
- "pep8-naming"
33+
args:
34+
- --ignore-names=setUp,tearDown,setUpClass,tearDownClass,asyncSetUp,asyncTearDown,setUpTestData,failureException,longMessage,maxDiff,startTestRun,stopTestRun
35+
36+
- repo: https://github.com/pre-commit/mirrors-prettier
37+
rev: v2.7.1
38+
hooks:
39+
- id: prettier
40+
41+
- repo: https://github.com/pycqa/pydocstyle
42+
rev: 6.1.1
43+
hooks:
44+
- id: pydocstyle
45+
46+
- repo: https://github.com/windpioneers/pre-commit-hooks
47+
rev: 0.0.5
48+
hooks:
49+
- id: check-branch-name
50+
args:
51+
- "^main$"
52+
- "^development$"
53+
- "^devops/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
54+
- "^doc/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
55+
- "^feature/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
56+
- "^enhancement/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
57+
- "^fix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
58+
- "^hotfix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
59+
- "^review/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
60+
- "^refactor/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
61+
- "^test/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
62+
- "^style/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
63+
- "^deprecation/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
64+
- "^dependencies/([a-z][a-z0-9]*)(-[a-z0-9]+)*$"
65+
66+
- repo: https://github.com/octue/conventional-commits
67+
rev: 0.8.1
68+
hooks:
69+
- id: check-commit-message-is-conventional
70+
stages: [commit-msg]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# example-service-cloud-run
2-
Trying to get cloud run to deploy a template service
2+
3+
An example Octue service for deploying to Google Cloud Run. Questions can be sent to it at `octue/example-service-cloud-run:latest`.

app_configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"output_location": "gs://octue-sdk-python-test-bucket/example_output_datasets"
2+
"output_location": "gs://octue-sdk-python-test-bucket/example_output_datasets"
33
}
File renamed without changes.

app.py renamed to example_service_cloud_run/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from octue.resources import Datafile, Dataset
77

8-
from example_package.submodule import do_something
8+
from example_service_cloud_run.submodule import do_something
99

1010

1111
logger = logging.getLogger(__name__)
File renamed without changes.

0 commit comments

Comments
 (0)