Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: clean up & refactor majorly #171

Merged
merged 37 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a56bb15
feat: remove scripts and add then in one place ie Makefile
JaeAeich May 11, 2024
b854244
chore: restructure deployement stuff
JaeAeich May 11, 2024
2dd67a7
chore: rename src to tesk
JaeAeich May 11, 2024
eaa230c
typo
JaeAeich May 11, 2024
aea50bd
restructure tests folder
JaeAeich May 11, 2024
301bb54
rename core to service
JaeAeich May 11, 2024
5ff8a07
refactor makefile command names
JaeAeich May 11, 2024
7ef9206
restructure docs and tests
JaeAeich May 11, 2024
38a0f2c
add poetry and checks
JaeAeich May 11, 2024
5c301d9
add ruff and fix format and lint issues
JaeAeich May 12, 2024
439e9cb
add lint and format in CI and fix some stuff
JaeAeich May 12, 2024
743f073
test command
JaeAeich May 12, 2024
988009b
tests fixed a lil bit
JaeAeich May 12, 2024
e16775a
fix: console script
JaeAeich May 13, 2024
6c9d1be
chore: change dockerfile due to moving to pyproject
JaeAeich May 13, 2024
afc0b94
fix tests a lil more
JaeAeich May 13, 2024
6cedfd5
test: fix S3 filer location constraint
uniqueg May 13, 2024
d4cd1a1
test: fix test file path
uniqueg May 13, 2024
2a0b025
fix tests a lil more, only 2 failing
JaeAeich May 13, 2024
a9cd65a
tests fixed :) locally :(
JaeAeich May 14, 2024
91a9dc0
CI test fix
JaeAeich May 14, 2024
5cd4940
github actions cache, and create dep groups in pyproject for CI
JaeAeich May 14, 2024
166012e
feat: add spell-checker, code-review, fix format of image to oci, and…
JaeAeich May 16, 2024
444d3b3
feat: some CI checks
JaeAeich May 16, 2024
939d48e
fix: sourcery errors
JaeAeich May 18, 2024
868291b
fix: safety errors
JaeAeich May 18, 2024
ce82dbc
fix: bandit errors
JaeAeich May 18, 2024
e5ad07a
fix: mypy errors
JaeAeich May 18, 2024
92fce10
fix: CI
JaeAeich May 18, 2024
2b477d1
fix: remove sourcery because eww
JaeAeich May 18, 2024
2da83fb
chore: minor renaming stuff
JaeAeich May 18, 2024
b6d3e27
chore: rename to
JaeAeich May 18, 2024
9345667
fix: test ci
JaeAeich May 18, 2024
6d73f00
chore: remove coverage report
JaeAeich May 19, 2024
863ec10
chore: remove empty file
JaeAeich May 19, 2024
2dd5fc7
chore: remove helm install from CI
JaeAeich May 19, 2024
46cba22
chore: add badge
JaeAeich May 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .dockerignore
JaeAeich marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
.coverage
.pytest_cache/
.tox/
# Cache and dot files
.coverage/
.eggs/
tesk-core/containers/
.github/
.gitignore
.mypy_cache/
.pytest_cache/
.ruff/
.ruff_cache/
.venv/
# Docs and artifacts
./deployment
./docs
./images
# Build
./build
./dist
# Scripts and tools
./scripts
Makefile
PULL_REQUEST_TEMPLATE.md
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/general-purpose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Your issue may already be reported!
Please search on the [issue tracker](https://github.com/elixir-cloud-aai/TESK/issues) before creating one.

## Expected Behavior
<!--- If you're describing a bug, tell us what should happen -->
<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code to reproduce, if relevant -->
1.
2.
3.
4.

## Context
<!--- How has this issue affected you? What are you trying to accomplish? -->
<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Browser Name and version:
* Operating System and version (desktop or mobile):
* Link to your project:
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
name: Helm Chart Testing
name: Build and Publish Helm Charts

on:
pull_request:
branches: [master]
push:
branches:
- main
pull_request:
branches:
- main

jobs:
helm:
create-cluster:
name: Create k3s Cluster
runs-on: ubuntu-latest
needs: checkout
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -20,31 +26,47 @@ jobs:

- name: Create namespace
run: kubectl create ns tesk


helm-deps:
name: Helm Dependencies
runs-on: ubuntu-latest
needs: checkout
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Helm Deps
run: |
for dir in $(ls -d charts/*); do
for dir in $(ls -d deployment/charts/*); do
helm dependency update $dir;
done


helm-lint:
name: Helm Lint
runs-on: ubuntu-latest
needs: [helm-deps]
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Helm Lint
run: |
for dir in $(ls -d charts/*); do
for dir in $(ls -d deployment/charts/*); do
helm lint $dir
done

- name: Apply Helm file
run: helm install -n tesk tesk . -f values.yaml
working-directory: charts/tesk

- name: Sleep for 30 seconds
run: sleep 30

- name: Get Helm and k8s
run: helm list -n tesk && kubectl get all -n tesk

- name: curl URL
run: curl localhost -vL

chart-releaser:
name: Run chart-releaser
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Configure Git
run: |
Expand All @@ -57,4 +79,3 @@ jobs:
skip_existing: true
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tesk-core-filer
name: Build and Publish Filer

on:
push:
Expand All @@ -14,6 +14,7 @@ on:

jobs:
build-from-source:
name: Build and publish Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout elixir-cloud-aai/tesk-core
Expand Down Expand Up @@ -43,7 +44,7 @@ jobs:
with:
context: .
push: true
file: ./containers/filer.Dockerfile
file: ./deployment/containers/filer.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tesk-core-taskmaster
name: Build and Publish Taskmaster

on:
push:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
with:
context: .
push: true
file: ./containers/taskmaster.Dockerfile
file: ./deployment/containers/taskmaster.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

102 changes: 102 additions & 0 deletions .github/workflows/code_quality.yaml
uniqueg marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Code Quality

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
id: cq
with:
python-version: '3.11'
cache: 'poetry'

- name: Install lint dependencies
run: poetry install --only=lint --no-interaction --no-root

- name: Check code quality
run: poetry run ruff check .

format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
id: cq
with:
python-version: '3.11'
cache: 'poetry'

- name: Install lint dependencies
run: poetry install --only=lint --no-interaction --no-root

- name: Check code style
run: poetry run ruff format --check

type-check:
name: Type Check
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up python
id: cqtc
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'

- name: Install types and mypy dependencies
run: poetry install --only=types --no-interaction --no-root

- name: Check types
run: poetry run mypy tesk/

spell-check:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
id: cq
with:
python-version: '3.11'
cache: 'poetry'

- name: Install lint dependencies
run: poetry install --only=lint --no-interaction --no-root

- name: Check spellings
run: poetry run typos .
42 changes: 42 additions & 0 deletions .github/workflows/code_test_unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code Test Unit

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
unit-test:
name: Unit Test
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python
uses: actions/setup-python@v5
id: ct
with:
python-version: '3.11'
cache: 'poetry'

- name: Install test dependencies
run: poetry install --only=test --no-interaction

- name: Run tests and generate coverage as test_unit.xml
run: poetry run pytest --cov-report term --cov-report xml:test_unit.xml --cov=tests/test_unit

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: test_unit
files: ./test_unit.xml
fail_ci_if_error: true
verbose: true
25 changes: 0 additions & 25 deletions .github/workflows/tox.yml

This file was deleted.

Loading
Loading