Skip to content

Commit 992d8be

Browse files
authored
✨ Re-introduce aws-library (#5031)
1 parent 4d75a0c commit 992d8be

File tree

128 files changed

+2681
-2062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+2681
-2062
lines changed

.github/codeql/codeql-config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: "ospac-simcore CodeQL config"
33
disable-default-queries: false
44

55
paths:
6+
- packages/aws-library/src
67
- packages/dask-task-models-library/src
78
- packages/models-library/src/models_library
89
- packages/postgres-database/src/simcore_postgres_database

.github/workflows/ci-testing-deploy.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
runs-on: ubuntu-latest
5151
# Set job outputs to values from filter step
5252
outputs:
53+
aws-library: ${{ steps.filter.outputs.aws-library }}
5354
dask-task-models-library: ${{ steps.filter.outputs.dask-task-models-library }}
5455
models-library: ${{ steps.filter.outputs.models-library }}
5556
postgres-database: ${{ steps.filter.outputs.postgres-database }}
@@ -87,6 +88,12 @@ jobs:
8788
id: filter
8889
with:
8990
filters: |
91+
aws-library:
92+
- 'packages/aws-library/**'
93+
- 'packages/pytest-simcore/**'
94+
- 'services/docker-compose*'
95+
- 'scripts/mypy/*'
96+
- 'mypy.ini'
9097
dask-task-models-library:
9198
- 'packages/dask-task-models-library/**'
9299
- 'packages/pytest-simcore/**'
@@ -804,6 +811,45 @@ jobs:
804811
with:
805812
flags: unittests #optional
806813

814+
unit-test-aws-library:
815+
needs: changes
816+
if: ${{ needs.changes.outputs.aws-library == 'true' || github.event_name == 'push' }}
817+
timeout-minutes: 18 # if this timeout gets too small, then split the tests
818+
name: "[unit] aws-library"
819+
runs-on: ${{ matrix.os }}
820+
strategy:
821+
matrix:
822+
python: ["3.10"]
823+
os: [ubuntu-22.04]
824+
docker_buildx: [v0.10.4]
825+
fail-fast: false
826+
steps:
827+
- uses: actions/checkout@v4
828+
- name: setup docker buildx
829+
id: buildx
830+
uses: docker/setup-buildx-action@v3
831+
with:
832+
version: ${{ matrix.docker_buildx }}
833+
driver: docker-container
834+
- name: setup python environment
835+
uses: actions/setup-python@v4
836+
with:
837+
python-version: ${{ matrix.python }}
838+
cache: "pip"
839+
cache-dependency-path: "packages/aws-library/requirements/ci.txt"
840+
- name: show system version
841+
run: ./ci/helpers/show_system_versions.bash
842+
- name: install
843+
run: ./ci/github/unit-testing/aws-library.bash install
844+
- name: typecheck
845+
run: ./ci/github/unit-testing/aws-library.bash typecheck
846+
- name: test
847+
if: always()
848+
run: ./ci/github/unit-testing/aws-library.bash test
849+
- uses: codecov/[email protected]
850+
with:
851+
flags: unittests #optional
852+
807853
unit-test-dask-task-models-library:
808854
needs: changes
809855
if: ${{ needs.changes.outputs.dask-task-models-library == 'true' || github.event_name == 'push' }}
@@ -1447,6 +1493,7 @@ jobs:
14471493
unit-test-catalog,
14481494
unit-test-clusters-keeper,
14491495
unit-test-dask-sidecar,
1496+
unit-test-aws-library,
14501497
unit-test-dask-task-models-library,
14511498
unit-test-datcore-adapter,
14521499
unit-test-director-v2,

.vscode/settings.template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"python.analysis.autoImportCompletions": true,
3333
"python.analysis.typeCheckingMode": "basic",
3434
"python.analysis.extraPaths": [
35+
"./packages/aws-library/src",
3536
"./packages/models-library/src",
3637
"./packages/postgres-database/src",
3738
"./packages/postgres-database/tests",
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
3+
set -o errexit # abort on nonzero exitstatus
4+
set -o nounset # abort on unbound variable
5+
set -o pipefail # don't hide errors within pipes
6+
IFS=$'\n\t'
7+
8+
install() {
9+
bash ci/helpers/ensure_python_pip.bash
10+
make devenv
11+
# shellcheck source=/dev/null
12+
source .venv/bin/activate
13+
pushd packages/aws-library
14+
make install-ci
15+
popd
16+
.venv/bin/pip list --verbose
17+
}
18+
19+
test() {
20+
# shellcheck source=/dev/null
21+
source .venv/bin/activate
22+
pushd packages/aws-library
23+
make tests-ci
24+
popd
25+
}
26+
27+
typecheck() {
28+
pushd packages/aws-library
29+
make mypy
30+
popd
31+
}
32+
33+
# Check if the function exists (bash specific)
34+
if declare -f "$1" >/dev/null; then
35+
# call arguments verbatim
36+
"$@"
37+
else
38+
# Show a helpful error
39+
echo "'$1' is not a known function name" >&2
40+
exit 1
41+
fi

packages/aws-library/Makefile

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#
2+
# Targets for DEVELOPMENT of aws Library
3+
#
4+
include ../../scripts/common.Makefile
5+
include ../../scripts/common-package.Makefile
6+
7+
.PHONY: requirements
8+
requirements: ## compiles pip requirements (.in -> .txt)
9+
@$(MAKE_C) requirements reqs
10+
11+
12+
.PHONY: install-dev install-prod install-ci
13+
install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode
14+
# installing in $(subst install-,,$@) mode
15+
pip-sync requirements/$(subst install-,,$@).txt
16+
17+
18+
.PHONY: tests tests-ci
19+
tests: ## runs unit tests
20+
# running unit tests
21+
@pytest \
22+
--asyncio-mode=auto \
23+
--color=yes \
24+
--cov-config=../../.coveragerc \
25+
--cov-report=term-missing \
26+
--cov=aws_library \
27+
--durations=10 \
28+
--exitfirst \
29+
--failed-first \
30+
--pdb \
31+
-vv \
32+
$(CURDIR)/tests
33+
34+
tests-ci: ## runs unit tests
35+
# running unit tests
36+
@pytest \
37+
--asyncio-mode=auto \
38+
--color=yes \
39+
--cov-append \
40+
--cov-config=../../.coveragerc \
41+
--cov-report=term-missing \
42+
--cov-report=xml \
43+
--cov=aws_library \
44+
--durations=10 \
45+
--log-date-format="%Y-%m-%d %H:%M:%S" \
46+
--log-format="%(asctime)s %(levelname)s %(message)s" \
47+
--verbose \
48+
-m "not heavy_load" \
49+
$(CURDIR)/tests

packages/aws-library/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# simcore AWS library
2+
3+
Provides a wrapper around AWS python libraries.
4+
5+
Requirements to be compatible with the library:
6+
7+
- only AWS-related code
8+
9+
10+
## Installation
11+
12+
```console
13+
make help
14+
make install-dev
15+
```
16+
17+
## Test
18+
19+
```console
20+
make help
21+
make test-dev
22+
```

packages/aws-library/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# Targets to pip-compile requirements
3+
#
4+
include ../../../requirements/base.Makefile
5+
6+
# Add here any extra explicit dependency: e.g. _migration.txt: _base.txt
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# Specifies third-party dependencies for 'aws-library'
3+
#
4+
--constraint ../../../requirements/constraints.txt
5+
--requirement ../../../packages/models-library/requirements/_base.in
6+
--requirement ../../../packages/service-library/requirements/_base.in
7+
--requirement ../../../packages/settings-library/requirements/_base.in
8+
9+
aioboto3
10+
aiocache
11+
pydantic[email]
12+
types-aiobotocore[ec2]

0 commit comments

Comments
 (0)