Skip to content

Commit

Permalink
update to use service-activity-monitor
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Neagu committed Mar 26, 2024
1 parent bec3433 commit 9ba6c70
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 1,061 deletions.
Binary file added .coverage
Binary file not shown.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ docker-compose.yml
validation/

*.ignore.*
.coverage
2 changes: 1 addition & 1 deletion .osparc/jupyter-math/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ paths-mapping:
callbacks-mapping:
inactivity:
service: container
command: ["python", "/docker/activity.py"]
command: ["python", "/usr/local/bin/service-monitor/activity.py"]
timeout: 1
22 changes: 20 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,26 @@ ENV JP_LSP_VIRTUAL_DIR="/home/${NB_USER}/.virtual_documents"
# Copying boot scripts
COPY --chown=$NB_UID:$NB_GID docker /docker

RUN chmod +x /docker/activity.py \
&& chmod +x /docker/activity_monitor.py
# install service activity monitor
ARG ACTIVITY_MONITOR_VERSION=v0.0.1

# Detection thresholds for application
ENV ACTIVITY_MONITOR_BUSY_THRESHOLD_CPU_PERCENT=0.5
ENV ACTIVITY_MONITOR_BUSY_THRESHOLD_DISK_READ_BPS=0
ENV ACTIVITY_MONITOR_BUSY_THRESHOLD_DISK_WRITE_BPS=0
ENV ACTIVITY_MONITOR_BUSY_THRESHOLD_NETWORK_RECEIVE_BPS=1024
ENV ACTIVITY_MONITOR_BUSY_THRESHOLD_NETWORK_SENT_BPS=1024

# install service activity monitor
RUN apt-get update && \
apt-get install -y curl && \
# install using curl
curl -sSL https://raw.githubusercontent.com/ITISFoundation/service-activity-monitor/main/scripts/install.sh | \
bash -s -- ${ACTIVITY_MONITOR_VERSION} && \
# cleanup and remove curl
apt-get purge -y --auto-remove curl && \
rm -rf /var/lib/apt/lists/*


RUN echo 'export PATH="/home/${NB_USER}/.venv/bin:$PATH"' >> "/home/${NB_USER}/.bashrc"

Expand Down
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,6 @@ publish-local: ## push to local throw away registry to test integration
docker push registry:5000/simcore/services/dynamic/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
@curl registry:5000/v2/_catalog | jq

.PHONY: install-test
install-test: ## install dependencies for testing
pip install -r requirements/test.txt

.PHONY: tests-dev
tests-dev: ## run tests in development mode
.venv/bin/pytest --pdb -vvv tests

.PHONY: tests-ci
tests-ci: ## run testds in the CI
.venv/bin/pytest -vvv --color=yes --cov-report term --cov=activity_monitor tests

.PHONY: help
help: ## this colorful help
@echo "Recipes for '$(notdir $(CURDIR))':"
Expand Down
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ If you already have a local copy of **o<sup>2</sup>S<sup>2</sup>PARC** running a
make publish-local
```

Setup for test development locally:

```shell
make devenv
source .venv/bin/activate
make tests-dev
```


### Testing manually
After a new service version has been published on the master deployment, it can be manually tested. For example a Template, called "Test Jupyter-math 2.0.9 ipywidgets" can be used for internal testing on the master deployment.

Expand Down
4 changes: 0 additions & 4 deletions docker/activity.py

This file was deleted.

Loading

0 comments on commit 9ba6c70

Please sign in to comment.