Skip to content

Commit

Permalink
✨ introducing elastic file system guardian (OPS ⚠️) (ITISFoundation#5887
Browse files Browse the repository at this point in the history
)
  • Loading branch information
matusdrobuliak66 authored May 31, 2024
1 parent 08c999a commit e28db90
Show file tree
Hide file tree
Showing 56 changed files with 1,745 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Makefile @pcrespov @sanderegg
/services/director*/ @sanderegg @pcrespov @GitHK
/services/docker-compose*.yml @sanderegg @mrnicegyu11 @YuryHrytsuk
/services/dynamic-sidecar/ @GitHK
/services/efs-guardian/ @matusdrobuliak66
/services/invitations/ @pcrespov
/services/migration/ @pcrespov
/services/osparc-gateway-server/ @sanderegg
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
director: ${{ steps.filter.outputs.director }}
director-v2: ${{ steps.filter.outputs.director-v2 }}
dynamic-sidecar: ${{ steps.filter.outputs.dynamic-sidecar }}
efs-guardian: ${{ steps.filter.outputs.efs-guardian }}
invitations: ${{ steps.filter.outputs.invitations }}
migration: ${{ steps.filter.outputs.migration }}
osparc-gateway-server: ${{ steps.filter.outputs.osparc-gateway-server }}
Expand Down Expand Up @@ -199,6 +200,12 @@ jobs:
- 'services/docker-compose*'
- 'scripts/mypy/*'
- 'mypy.ini'
efs-guardian:
- 'packages/**'
- 'services/efs-guardian/**'
- 'services/docker-compose*'
- 'scripts/mypy/*'
- 'mypy.ini'
invitations:
- 'packages/**'
- 'services/invitations/**'
Expand Down Expand Up @@ -1207,6 +1214,58 @@ jobs:
with:
flags: unittests #optional

unit-test-efs-guardian:
needs: changes
if: ${{ needs.changes.outputs.efs-guardian == 'true' || github.event_name == 'push' }}
timeout-minutes: 18 # if this timeout gets too small, then split the tests
name: "[unit] efs-guardian"
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ["3.10"]
os: [ubuntu-22.04]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: setup docker buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
- name: setup python environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: install uv
uses: yezz123/setup-uv@v4
- uses: actions/cache@v4
id: cache-uv
with:
path: ~/.cache/uv
key: ${{ runner.os }}-${{ github.job }}-python-${{ matrix.python }}-uv
- name: show system version
run: ./ci/helpers/show_system_versions.bash
- name: install
run: |
make devenv
source .venv/bin/activate && \
pushd services/efs-guardian && \
make install-ci
- name: typecheck
run: |
source .venv/bin/activate && \
pushd services/efs-guardian && \
make mypy
- name: test
if: always()
run: |
source .venv/bin/activate && \
pushd services/efs-guardian && \
make test-ci-unit
- uses: codecov/[email protected]
with:
flags: unittests #optional

unit-test-frontend:
needs: changes
if: ${{ needs.changes.outputs.static-webserver == 'true' || github.event_name == 'push' }}
Expand Down Expand Up @@ -1638,6 +1697,7 @@ jobs:
unit-test-director-v2,
unit-test-director,
unit-test-dynamic-sidecar,
unit-test-efs-guardian,
unit-test-frontend,
unit-test-models-library,
unit-test-notifications-library,
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ SERVICES_NAMES_TO_BUILD := \
director \
director-v2 \
dynamic-sidecar \
efs-guardian \
invitations \
migration \
osparc-gateway-server \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .helpers.utils_envs import delenvs_from_dict, load_dotenv, setenvs_from_dict


@pytest.fixture(scope="session")
@pytest.fixture(scope="session") # MD: get this, I will mock it with my app environmnet
def env_devel_dict(env_devel_file: Path) -> EnvVarsDict:
assert env_devel_file.exists()
assert env_devel_file.name == ".env-devel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"datcore-adapter": "/v0/live",
"director-v2": "/",
"dynamic-schdlr": "/",
"efs-guardian": "/",
"invitations": "/",
"payments": "/",
"resource-usage-tracker": "/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def check_if_cluster_is_able_to_run_pipeline(
json_dumps(task_resources, indent=2),
)

if can_a_worker_run_task:
if can_a_worker_run_task: # OsparcErrorMixin
return

# check if we have missing resources
Expand Down
16 changes: 16 additions & 0 deletions services/docker-compose-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,22 @@ services:
org.opencontainers.image.source: "${VCS_URL}"
org.opencontainers.image.revision: "${VCS_REF}"

efs-guardian:
image: local/efs-guardian:${BUILD_TARGET:?build_target_required}
build:
context: ../
dockerfile: services/efs-guardian/Dockerfile
cache_from:
- local/efs-guardian:${BUILD_TARGET:?build_target_required}
- ${DOCKER_REGISTRY:-itisfoundation}/efs-guardian:master-github-latest
- ${DOCKER_REGISTRY:-itisfoundation}/efs-guardian:staging-github-latest
- ${DOCKER_REGISTRY:-itisfoundation}/efs-guardian:release-github-latest
target: ${BUILD_TARGET:?build_target_required}
labels:
org.opencontainers.image.created: "${BUILD_DATE}"
org.opencontainers.image.source: "${VCS_URL}"
org.opencontainers.image.revision: "${VCS_REF}"

invitations:
image: local/invitations:${BUILD_TARGET:?build_target_required}
build:
Expand Down
2 changes: 2 additions & 0 deletions services/docker-compose-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ services:
image: ${DOCKER_REGISTRY:-itisfoundation}/director-v2:${DOCKER_IMAGE_TAG:-latest}
dynamic-sidecar:
image: ${DOCKER_REGISTRY:-itisfoundation}/dynamic-sidecar:${DOCKER_IMAGE_TAG:-latest}
efs-guardian:
image: ${DOCKER_REGISTRY:-itisfoundation}/efs-guardian:${DOCKER_IMAGE_TAG:-latest}
invitations:
image: ${DOCKER_REGISTRY:-itisfoundation}/invitations:${DOCKER_IMAGE_TAG:-latest}
migration:
Expand Down
8 changes: 8 additions & 0 deletions services/docker-compose.devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ services:
- ./director-v2:/devel/services/director-v2
- ../packages:/devel/packages

efs-guardian:
environment:
<<: *common-environment
EFS_GUARDIAN_LOGLEVEL: DEBUG
volumes:
- ./efs-guardian:/devel/services/efs-guardian
- ../packages:/devel/packages

static-webserver:
volumes:
- ./static-webserver/client/source-output:/static-content
Expand Down
8 changes: 8 additions & 0 deletions services/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ services:
- "8000"
- "3010:3000"

efs-guardian:
environment:
<<: *common_environment
EFS_GUARDIAN_REMOTE_DEBUGGING_PORT : 3000
ports:
- "8013:8000"
- "3020:3000"

invitations:
environment:
<<: *common_environment
Expand Down
9 changes: 9 additions & 0 deletions services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@ services:
- computational_services_subnet
secrets: *dask_tls_secrets

efs-guardian:
image: ${DOCKER_REGISTRY:-itisfoundation}/efs-guardian:${DOCKER_IMAGE_TAG:-latest}
init: true
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
networks:
- default
environment:
LOG_FORMAT_LOCAL_DEV_ENABLED: ${LOG_FORMAT_LOCAL_DEV_ENABLED}

invitations:
image: ${DOCKER_REGISTRY:-itisfoundation}/invitations:${DOCKER_IMAGE_TAG:-latest}
init: true
Expand Down
Loading

0 comments on commit e28db90

Please sign in to comment.