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

✨ Re-introduce aws-library #5031

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
56cf0c5
added skeleton
sanderegg Nov 7, 2023
17c4741
preparing new library
sanderegg Nov 7, 2023
a548063
fixes tests
sanderegg Nov 7, 2023
97fffa9
add ec2 folder
sanderegg Nov 10, 2023
90ec363
adding dependency to aws-library
sanderegg Nov 10, 2023
affac84
moving models
sanderegg Nov 10, 2023
c047cdd
moved models to aws-library
sanderegg Nov 10, 2023
c00fe58
added error
sanderegg Nov 10, 2023
5ddedbd
add empty shell for client
sanderegg Nov 10, 2023
ae60176
added aiocache
sanderegg Nov 10, 2023
d7b2ed1
wrong coverage name
sanderegg Nov 10, 2023
3e4c833
add dependency
sanderegg Nov 10, 2023
6ea6c1f
add dependency
sanderegg Nov 10, 2023
38bea17
bring in all
sanderegg Nov 10, 2023
7cdc987
rename
sanderegg Nov 10, 2023
db83065
testing
sanderegg Nov 10, 2023
85c768c
creating tests
sanderegg Nov 10, 2023
00d6704
add testing dependencies
sanderegg Nov 11, 2023
0e07f48
test runs on client
sanderegg Nov 11, 2023
9114070
moved get_local_host method to dockerless utils
sanderegg Nov 11, 2023
349409d
correct imports + ruff
sanderegg Nov 12, 2023
8b99f81
add moto server as pytest-simcore fixtures
sanderegg Nov 12, 2023
40f39d6
fixed import
sanderegg Nov 12, 2023
339db72
preparing for testing
sanderegg Nov 12, 2023
149d968
refactoring
sanderegg Nov 12, 2023
85f72e6
100% coverage
sanderegg Nov 12, 2023
0781d2a
ruff
sanderegg Nov 12, 2023
cc4c2d5
removed ec2instancessettings
sanderegg Nov 12, 2023
e277b25
Squashed commit of the following:
sanderegg Nov 12, 2023
bc268ab
removed duplicated tests
sanderegg Nov 13, 2023
44fb75c
improve client
sanderegg Nov 13, 2023
04d9d71
update client and models based on clusters-keeper
sanderegg Nov 13, 2023
7afdda7
re-use ec2 client from aws-library
sanderegg Nov 13, 2023
ced2317
re-use ec2 settings
sanderegg Nov 13, 2023
8c3c4b6
re-use ec2 client
sanderegg Nov 13, 2023
47fa781
add aws-lib dependency
sanderegg Nov 13, 2023
cf50a07
all models are already defined in aws-lib
sanderegg Nov 13, 2023
7d2f230
missing entry
sanderegg Nov 13, 2023
1a886d6
typo
sanderegg Nov 13, 2023
c920c84
missing arguments
sanderegg Nov 13, 2023
0693768
mypy
sanderegg Nov 13, 2023
9941be9
ruff
sanderegg Nov 13, 2023
6f5b6fc
linter
sanderegg Nov 13, 2023
8a42bcd
split fixtures
sanderegg Nov 13, 2023
e0999db
use ec2 fixtures
sanderegg Nov 13, 2023
647ad05
use pytest-simcore fixtures
sanderegg Nov 13, 2023
6c7dcd2
ruff
sanderegg Nov 13, 2023
b269fb5
ruff
sanderegg Nov 13, 2023
5c44a8e
re-use fixtures
sanderegg Nov 13, 2023
86d8d80
removed aws_services.py
sanderegg Nov 13, 2023
afdeac6
migration done?
sanderegg Nov 13, 2023
de838e6
ruff
sanderegg Nov 13, 2023
c7ad24b
missing dependency
sanderegg Nov 13, 2023
7813d5f
cleanup
sanderegg Nov 13, 2023
c4c94fc
ruff
sanderegg Nov 13, 2023
b3efa59
migrate
sanderegg Nov 13, 2023
4059e89
ruff
sanderegg Nov 13, 2023
b3efb81
migrating
sanderegg Nov 13, 2023
e577020
fix fixture name
sanderegg Nov 13, 2023
9243b59
add flaky
sanderegg Nov 13, 2023
5853e0b
fixed imports
sanderegg Nov 13, 2023
1ec65d5
fix imports
sanderegg Nov 13, 2023
8580087
correct fixture name
sanderegg Nov 13, 2023
f00ac46
remove duplicate fixtures
sanderegg Nov 13, 2023
cb6adb5
added dependencies
sanderegg Nov 13, 2023
5366926
type
sanderegg Nov 13, 2023
dcf380c
dependencies
sanderegg Nov 13, 2023
5667173
fixed test
sanderegg Nov 13, 2023
e2d0354
use env_prefix
sanderegg Nov 13, 2023
281de5c
typo
sanderegg Nov 13, 2023
f464b17
fix environs
sanderegg Nov 13, 2023
bb47cd8
separate api_schema from internal model
sanderegg Nov 13, 2023
7e7a4e4
fix test
sanderegg Nov 13, 2023
af9a79b
fix test
sanderegg Nov 13, 2023
c6a31e1
@pcrespov review: add examples
sanderegg Nov 14, 2023
26a9a4c
remove dependency to types_aiobotocore
sanderegg Nov 14, 2023
9872f05
mypy
sanderegg Nov 14, 2023
89e5ba5
fix call that fails in real AWS
sanderegg Nov 14, 2023
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
1 change: 1 addition & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: "ospac-simcore CodeQL config"
disable-default-queries: false

paths:
- packages/aws-library/src
- packages/dask-task-models-library/src
- packages/models-library/src/models_library
- packages/postgres-database/src/simcore_postgres_database
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
aws-library: ${{ steps.filter.outputs.aws-library }}
dask-task-models-library: ${{ steps.filter.outputs.dask-task-models-library }}
models-library: ${{ steps.filter.outputs.models-library }}
postgres-database: ${{ steps.filter.outputs.postgres-database }}
Expand Down Expand Up @@ -87,6 +88,12 @@ jobs:
id: filter
with:
filters: |
aws-library:
- 'packages/aws-library/**'
- 'packages/pytest-simcore/**'
- 'services/docker-compose*'
- 'scripts/mypy/*'
- 'mypy.ini'
dask-task-models-library:
- 'packages/dask-task-models-library/**'
- 'packages/pytest-simcore/**'
Expand Down Expand Up @@ -804,6 +811,45 @@ jobs:
with:
flags: unittests #optional

unit-test-aws-library:
needs: changes
if: ${{ needs.changes.outputs.aws-library == 'true' || github.event_name == 'push' }}
timeout-minutes: 18 # if this timeout gets too small, then split the tests
name: "[unit] aws-library"
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ["3.10"]
os: [ubuntu-22.04]
docker_buildx: [v0.10.4]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ matrix.docker_buildx }}
driver: docker-container
- name: setup python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "packages/aws-library/requirements/ci.txt"
- name: show system version
run: ./ci/helpers/show_system_versions.bash
- name: install
run: ./ci/github/unit-testing/aws-library.bash install
- name: typecheck
run: ./ci/github/unit-testing/aws-library.bash typecheck
- name: test
if: always()
run: ./ci/github/unit-testing/aws-library.bash test
- uses: codecov/[email protected]
with:
flags: unittests #optional

unit-test-dask-task-models-library:
needs: changes
if: ${{ needs.changes.outputs.dask-task-models-library == 'true' || github.event_name == 'push' }}
Expand Down Expand Up @@ -1447,6 +1493,7 @@ jobs:
unit-test-catalog,
unit-test-clusters-keeper,
unit-test-dask-sidecar,
unit-test-aws-library,
unit-test-dask-task-models-library,
unit-test-datcore-adapter,
unit-test-director-v2,
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"python.analysis.autoImportCompletions": true,
"python.analysis.typeCheckingMode": "basic",
"python.analysis.extraPaths": [
"./packages/aws-library/src",
"./packages/models-library/src",
"./packages/postgres-database/src",
"./packages/postgres-database/tests",
Expand Down
41 changes: 41 additions & 0 deletions ci/github/unit-testing/aws-library.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -o errexit # abort on nonzero exitstatus
set -o nounset # abort on unbound variable
set -o pipefail # don't hide errors within pipes
IFS=$'\n\t'

install() {
bash ci/helpers/ensure_python_pip.bash
make devenv
# shellcheck source=/dev/null
source .venv/bin/activate
pushd packages/aws-library
make install-ci
popd
.venv/bin/pip list --verbose
}

test() {
# shellcheck source=/dev/null
source .venv/bin/activate
pushd packages/aws-library
make tests-ci
popd
}

typecheck() {
pushd packages/aws-library
make mypy
popd
}

# Check if the function exists (bash specific)
if declare -f "$1" >/dev/null; then
# call arguments verbatim
"$@"
else
# Show a helpful error
echo "'$1' is not a known function name" >&2
exit 1
fi
49 changes: 49 additions & 0 deletions packages/aws-library/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Targets for DEVELOPMENT of aws Library
#
include ../../scripts/common.Makefile
include ../../scripts/common-package.Makefile

.PHONY: requirements
requirements: ## compiles pip requirements (.in -> .txt)
@$(MAKE_C) requirements reqs


.PHONY: install-dev install-prod install-ci
install-dev install-prod install-ci: _check_venv_active ## install app in development/production or CI mode
# installing in $(subst install-,,$@) mode
pip-sync requirements/$(subst install-,,$@).txt


.PHONY: tests tests-ci
tests: ## runs unit tests
# running unit tests
@pytest \
--asyncio-mode=auto \
--color=yes \
--cov-config=../../.coveragerc \
--cov-report=term-missing \
--cov=aws_library \
--durations=10 \
--exitfirst \
--failed-first \
--pdb \
-vv \
$(CURDIR)/tests

tests-ci: ## runs unit tests
# running unit tests
@pytest \
--asyncio-mode=auto \
--color=yes \
--cov-append \
--cov-config=../../.coveragerc \
--cov-report=term-missing \
--cov-report=xml \
--cov=aws_library \
--durations=10 \
--log-date-format="%Y-%m-%d %H:%M:%S" \
--log-format="%(asctime)s %(levelname)s %(message)s" \
--verbose \
-m "not heavy_load" \
$(CURDIR)/tests
22 changes: 22 additions & 0 deletions packages/aws-library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# simcore AWS library

Provides a wrapper around AWS python libraries.

Requirements to be compatible with the library:

- only AWS-related code


## Installation

```console
make help
make install-dev
```

## Test

```console
make help
make test-dev
```
1 change: 1 addition & 0 deletions packages/aws-library/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.0
6 changes: 6 additions & 0 deletions packages/aws-library/requirements/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Targets to pip-compile requirements
#
include ../../../requirements/base.Makefile

# Add here any extra explicit dependency: e.g. _migration.txt: _base.txt
12 changes: 12 additions & 0 deletions packages/aws-library/requirements/_base.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#
# Specifies third-party dependencies for 'aws-library'
#
--constraint ../../../requirements/constraints.txt
--requirement ../../../packages/models-library/requirements/_base.in
--requirement ../../../packages/service-library/requirements/_base.in
--requirement ../../../packages/settings-library/requirements/_base.in

aioboto3
aiocache
pydantic[email]
types-aiobotocore[ec2]
Loading
Loading