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

Commit a47a354

Browse files
author
Thinh Nguyen
authored
Merge pull request #7 from iamamutt/main
refactor(workflow): 🎨 update workflow to use submodules
2 parents f6d91b8 + 1f124a0 commit a47a354

File tree

29 files changed

+95
-62
lines changed

29 files changed

+95
-62
lines changed

datajoint-workflow/cookiecutter.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"author_email": "{{cookiecutter.author_name|words(1)|lower}}@datajoint.com",
44
"organization": "Science Institute",
55
"workflow": "Brain Lab",
6-
"pkg_type": "SciOps",
76
"github_user": [
87
"dj-sciops",
98
"datajoint",
@@ -19,11 +18,11 @@
1918
"3.10",
2019
"3.8"
2120
],
22-
"_pkg_version": "0.0.1",
21+
"_pkg_version": "0.0.0",
2322
"homepage_url": "https://github.com/{{cookiecutter.github_user}}",
2423
"docs_url": "https://{{cookiecutter.github_user}}.github.io/{{cookiecutter.github_repo}}",
25-
"__project_name": "{{cookiecutter.pkg_type|lower}}-{{cookiecutter.workflow|slugify}}",
26-
"__pkg_import_name": "{{cookiecutter.pkg_type|lower}}_{{cookiecutter.workflow|slugify(separator='_')}}",
24+
"__project_name": "{{cookiecutter.workflow|slugify}}",
25+
"__pkg_import_name": "{{cookiecutter.workflow|slugify(separator='_')}}",
2726
"_djconfig": "dj_local_conf.json",
2827
"_copy_without_render": [
2928
"docs/assets/*.svg",

datajoint-workflow/scripts/retrocookie/retrocookie.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ create_commits() {
168168
exit 0
169169
fi
170170
echo -e "\n----------- Adding and committing new files."
171-
git add .
171+
git add . :^src/*/version.py
172172
git commit -m "build(retrocookie): reflect updates to source template from generated project '$(basename "${tmp_proj_dir}")'" --no-verify
173173
COMMIT=$(git rev-parse HEAD)
174174
rev_num=$((rev_num + 1))

datajoint-workflow/{{cookiecutter.github_repo}}/.github/workflows/main-cicd.yml renamed to datajoint-workflow/{{cookiecutter.github_repo}}/.github/workflows/package-updates.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
# Run workflows that require semantic versioning info
2-
name: main-cicd
1+
# Run workflows that require semantic versioning info, updates to python package files, and builds.
2+
name: package-updates
3+
34
on:
45
workflow_run:
5-
workflows: [run-tests]
6-
types: [completed]
7-
branches: [main]
6+
workflows:
7+
- run-tests
8+
types:
9+
- completed
10+
branches:
11+
- main
812

913
jobs:
1014
call_semantic_versioning:
11-
if: ${{"{{"}} github.event.workflow_run.conclusion == 'success' {{"}}"}}
15+
if: github.event.workflow_run.conclusion == 'success'
1216
uses: {{cookiecutter.github_user}}/djsciops-cicd/.github/workflows/semantic-versioning.yml@main
1317
with:
14-
py_ver: "{{cookiecutter.python_version}}"
1518
create_release: true
16-
release_only: "['major','minor','patch']"
19+
release_types: major,minor,patch
20+
release_branch: main
1721

1822
call_mkdocs_build:
1923
needs: call_semantic_versioning
@@ -23,6 +27,7 @@ jobs:
2327
new_tag: ${{"{{"}} needs.call_semantic_versioning.outputs.new_tag {{"}}"}}
2428
branch_name: gh-pages
2529
py_ver: "{{cookiecutter.python_version}}"
30+
release_branch: main
2631

2732
call_sciops_docker_images:
2833
needs: call_semantic_versioning
@@ -44,7 +49,7 @@ jobs:
4449
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
4550

4651
if_run_tests_failed:
47-
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
52+
if: github.event.workflow_run.conclusion == 'failure'
4853
runs-on: ubuntu-latest
4954
steps:
5055
- run: |

datajoint-workflow/{{cookiecutter.github_repo}}/.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ name: run-tests
33

44
on:
55
workflow_run:
6-
workflows: [pre-commit]
7-
types: [completed]
6+
workflows:
7+
- pre-commit
8+
types:
9+
- completed
810
branches:
911
- main
1012

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
# Changelog
2-
3-
- [Version {{cookiecutter._pkg_version}}](https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.github_repo}}/releases/tag/v{{cookiecutter._pkg_version}})

datajoint-workflow/{{cookiecutter.github_repo}}/CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@ Format your commit messages so that they help create the appropriate semantic ve
7272

7373
_Conventional Commit Resources_:
7474

75-
- [Conventional commits](https://www.conventionalcommits.org/en/v1.0.0-beta.4/)
76-
- [More commit examples](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional)
77-
- [Angular format](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commit-message-format)
75+
- [`semantic-release`: GitHub Action used with this package](https://github.com/mathieudutour/github-tag-action)
76+
- Other [conventional](https://www.conventionalcommits.org/en/v1.0.0-beta.4/) commit [examples](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional) and [resources](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commit-message-format)
7877

7978
!!! tip "Commit History"
80-
Writing a [descriptive commit message](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commit-message-format) is highly recommended. In case of doubt, you can check the commit history to look for recurring communication patterns with:
79+
Writing a [descriptive commit message](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#-git-commit-guidelines) is highly recommended. In case of doubt, you can check the commit history to look for recurring communication patterns with:
8180

8281
git log --graph --decorate --pretty=oneline --abbrev-commit --all
8382

datajoint-workflow/{{cookiecutter.github_repo}}/README.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ _View the latest documentation site here:_ [{{cookiecutter.docs_url}}]({{cookiec
44

55
# `{{cookiecutter.__project_name}}`
66

7-
_A {{cookiecutter.workflow}} {{cookiecutter.pkg_type}} for {{cookiecutter.organization}}_
7+
_A {{cookiecutter.organization}} Workflow for {{cookiecutter.workflow}}_
88

99
## Description
1010

1111
TODO: finish description.
1212

13-
Welcome to the {{cookiecutter.organization}} {{cookiecutter.pkg_type}} service!
13+
Welcome to the {{cookiecutter.organization}} {{cookiecutter.workflow}} pipeline!
1414

1515
This service is designed for a user to upload their raw [_modality type_] data acquired with [_description_], which will then be automatically processed with [_..._]. The service also provides online Jupyter notebooks to visualize the results.
1616

@@ -21,7 +21,7 @@ This [workflow](https://github.com/{{cookiecutter.github_user}}/{{cookiecutter.g
2121

2222
Please follow the steps listed below to begin working with the platform.
2323

24-
## Using the {{cookiecutter.pkg_type}} Services
24+
## Using the SciOps Services
2525

2626
### Account Setup
2727

@@ -95,12 +95,12 @@ DataJoint LabBook displays data from your database.
9595
<!--intro-end-->
9696
<!--install-start-->
9797

98-
Thank you for using the {{cookiecutter.organization}} {{cookiecutter.pkg_type}} cloud-based platform.
98+
Thank you for using the {{cookiecutter.organization}}: _{{cookiecutter.workflow}}_ cloud-based platform.
9999

100100
## Installation
101101

102102
!!! note
103-
The following is intended for developers and is not required for users of the {{cookiecutter.pkg_type}} services.
103+
The following is intended for developers and is not required for users of the SciOps services.
104104

105105
### 1. Clone the repository
106106

@@ -165,11 +165,19 @@ See the [_Development setup_](./CONTRIBUTING.md#setting-up-a-local-development-e
165165
├── figures <- Generated plots and figures for sharing, reports or documentation.
166166
├── notebooks <- Jupyter notebooks. Naming convention is a number for
167167
│ ordering, the creator's initials, and a description.
168-
| For example, '1.0-fw-initial-data-exploration'.
168+
For example, '1.0-fw-initial-data-exploration'.
169169
├── scripts <- Analysis examples or production scripts which rely on
170170
│ importing the actual Python package, e.g. running queries.
171-
├── src
172-
│ └── {{cookiecutter.__pkg_import_name}} <- Actual Python package where the main functionality goes.
171+
├── src/
172+
│ └── {{cookiecutter.__pkg_import_name}}/ <- Actual Python package where the main functionality goes.
173+
│ └── pipeline/ <- Main schemas and tables used to run the datajoint pipeline.
174+
│ └── populate/ <- Code to run `populate` or to ingest data into the database.
175+
│ └── support/ <- Tables to add functionality to the main pipeline modules.
176+
│ └── tables/ <- Primary end-user tables defined for easy-of-use.
177+
│ └── utils/ <- Package utilities.
178+
│ └── __init__.py <- Root-level package init file.
179+
│ └── __main__.py <- Main package script.
180+
│ └── version.py <- Should only contain the current package version number.
173181
├── tests <- Unit and integration tests which can be run with `pytest` or `nox`.
174182
├── .cookiecutter.json <- Options specified during template generation.
175183
├── .gitignore <- Files and folders to ignore for git.

datajoint-workflow/{{cookiecutter.github_repo}}/configs/axon.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
# template for required information to use Axon.
22
version: "0.2.1"
33
aws:
44
account_id: ""

datajoint-workflow/{{cookiecutter.github_repo}}/docker/README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Docker Containers
22

3+
TODO: docker things
4+
- test image builds for resuable workflows
5+
- labhub multi conda envs
6+
- actions checkout
7+
38
Create a `.env` file and the change any variables as necessary, then source those variables for later use.
49

510
```bash
@@ -56,9 +61,9 @@ cd docker
5661
docker-compose -f docker-compose-codebook_env.yaml up --detach --force-recreate --remove-orphans --build
5762
```
5863

59-
## Standard {{cookiecutter.pkg_type}} Environment
64+
## Standard Worker Environment
6065

61-
...
66+
TODO: add description
6267

6368

6469
### Docker Compose

datajoint-workflow/{{cookiecutter.github_repo}}/docker/docker-compose-standard_workflow.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# docker-compose up --build
1+
# docker-compose up --build --detach
22
version: "2.4"
33
services:
44
standard_worker:

0 commit comments

Comments
 (0)