-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from danielfromearth/develop
update `main`
- Loading branch information
Showing
19 changed files
with
1,167 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
TEMPO_*.nc | ||
tests/ | ||
pytest.ini | ||
.git | ||
.gitignore | ||
.travis.yaml | ||
.swagger-codegen-ignore | ||
tox.ini | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
venv/ | ||
.python-version | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
# Intellij project settings | ||
.idea | ||
|
||
# VSCode project settings | ||
.vscode | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# ruff | ||
.ruff_cache/ | ||
# pytest | ||
.pytest_cache/ | ||
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# Github integration settings | ||
.github | ||
|
||
# .dockerignore and builder script themselves are not needed by | ||
# docker build. | ||
.dockerignore | ||
build-service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
FROM python:3.10-slim | ||
|
||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \ | ||
gcc \ | ||
libnetcdf-dev \ | ||
#libhdf5-dev \ | ||
#hdf5-helpers \ | ||
&& pip3 install --upgrade pip \ | ||
&& pip3 install cython \ | ||
&& pip3 install poetry \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Create a new user | ||
RUN adduser --quiet --disabled-password --shell /bin/sh --home /home/dockeruser --gecos "" --uid 1000 dockeruser | ||
USER dockeruser | ||
ENV HOME /home/dockeruser | ||
ENV PYTHONPATH "${PYTHONPATH}:/home/dockeruser/.local/bin" | ||
ENV PATH="/home/dockeruser/.local/bin:${PATH}" | ||
|
||
# The 'SOURCE' argument is what will be used in 'pip install'. | ||
ARG SOURCE | ||
|
||
# Set this argument if running the pip install on a local directory, so | ||
# the local dist files are copied into the container. | ||
ARG DIST_PATH | ||
|
||
USER root | ||
RUN mkdir -p /worker && chown dockeruser /worker | ||
COPY pyproject.toml /worker | ||
|
||
WORKDIR /worker | ||
# ENV PYTHONPATH=${PYTHONPATH}:${PWD} | ||
COPY --chown=dockeruser $DIST_PATH $DIST_PATH | ||
#RUN pip3 install --no-cache-dir --force --user --index-url https://pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ $SOURCE \ | ||
# && rm -rf $DIST_PATH | ||
|
||
#install poetry as root | ||
RUN poetry config virtualenvs.create false | ||
RUN poetry install --only main | ||
|
||
USER dockeruser | ||
COPY --chown=dockeruser ./docker-entrypoint.sh docker-entrypoint.sh | ||
# Run the service | ||
ENTRYPOINT ["./docker-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker build -t "asdc-trade/stitchee:${VERSION-latest}" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""A Harmony CLI wrapper around the concatenate-batcher""" | ||
from argparse import ArgumentParser | ||
|
||
import harmony | ||
|
||
from concatenator.harmony.service_adapter import StitcheeAdapter as HarmonyAdapter | ||
|
||
|
||
def main(config: harmony.util.Config = None) -> None: | ||
"""Parse command line arguments and invoke the service to respond to them. | ||
Parameters | ||
---------- | ||
config : harmony.util.Config | ||
harmony.util.Config is injectable for tests | ||
Returns | ||
------- | ||
None | ||
""" | ||
parser = ArgumentParser( | ||
prog="Stitchee", description="Run the STITCH by Extending a dimEnsion service" | ||
) | ||
harmony.setup_cli(parser) | ||
args = parser.parse_args() | ||
if harmony.is_harmony_cli(args): | ||
harmony.run_cli(parser, args, HarmonyAdapter, cfg=config) | ||
else: | ||
parser.error("Only --harmony CLIs are supported") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.