Skip to content

Commit

Permalink
Configured compose.yml to build j-sp image instead of pulling from re…
Browse files Browse the repository at this point in the history
…pository
  • Loading branch information
Nikita-Smirnov-Exactpro committed Sep 23, 2024
1 parent 73c7bb1 commit 1c66faf
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 7 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Copy base project files into the container at /app
COPY LICENSE NOTICE README.md package_info.json requirements.txt /app/

# groupadd --system - create a system account
# useradd --system - create a system account
Expand Down Expand Up @@ -41,5 +41,9 @@ ENV PIP_CONFIG_FILE="${HOME}/.pip/pip.conf"
RUN mkdir -p "${PYTHON_SHARED_LIB_PATH}"
RUN echo 'umask 0007' >> "${HOME}/.bashrc"

# Copy the json_stream_provider contents into the container at /app
COPY json_stream_provider /app/json_stream_provider
COPY server.py /app/

ENTRYPOINT ["python", "/app/server.py"]
CMD ["/var/th2/config/custom.json"]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ docker compose build

## Release notes:

### 0.0.7

* Custom engine holds separate papermill notebook client for each file.

### 0.0.6

* Added papermill custom engine to reuse it for notebook execution.
Expand Down
Empty file.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from pathlib import Path

Expand All @@ -22,7 +34,7 @@
from papermill.parameterize import add_builtin_parameters, parameterize_notebook, parameterize_path
from papermill.utils import chdir

from custom_engines import exactpro_papermill_engines
from json_stream_provider.custom_engines import exactpro_papermill_engines


# The code of this method is derived from https://github.com/nteract/papermill/blob/2.6.0 under the BSD License.
Expand Down
2 changes: 1 addition & 1 deletion package_info.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"package_name": "th2-json-stream-provider",
"package_version": "0.0.6"
"package_version": "0.0.7"
}
42 changes: 39 additions & 3 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,42 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import asyncio
import json
Expand All @@ -22,7 +58,7 @@
from enum import Enum
from typing import Coroutine, Any

import papermill_execute_ext as epm
from json_stream_provider import papermill_execute_ext as epm
import papermill as pm
from papermill.utils import chdir
from aiohttp import web
Expand All @@ -31,8 +67,8 @@
from aiojobs import Job
from aiojobs.aiohttp import setup

from custom_engines import CustomEngine, EngineBusyError
from log_configuratior import configure_logging
from json_stream_provider.custom_engines import CustomEngine, EngineBusyError
from json_stream_provider.log_configuratior import configure_logging

os.system('pip list')

Expand Down

0 comments on commit 1c66faf

Please sign in to comment.