diff --git a/.dockerignore b/.dockerignore index 1f9c96d..727c28c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,5 +11,6 @@ Dockerfile .github .vscode docs +!docs/hello_world.py scripts tests diff --git a/Dockerfile b/Dockerfile index 0579296..9f454ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,9 @@ ENV ENVIRONMENT=production EXPOSE 6060 # curl is needed for the healthcheck +# build-essentials are needed for building packages RUN DEBIAN_FRONTEND=noninteractive apt update &&\ - apt install curl -y &&\ + apt install curl build-essential -y &&\ rm -rf /var/lib/apt/lists/* WORKDIR /dependencies @@ -29,4 +30,7 @@ HEALTHCHECK \ WORKDIR /app VOLUME /app +COPY docs/hello_world.py . + ENTRYPOINT ["/usr/local/bin/python3", "-m", "great_ai"] +CMD ["hello_world.py"] diff --git a/README.md b/README.md index fa312ae..24d203f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,34 @@ # GreatAI +**work in progress, do not use!** + [![Test](https://github.com/ScoutinScience/great_ai/actions/workflows/test.yml/badge.svg)](https://github.com/ScoutinScience/great_ai/actions/workflows/check.yml) [![Quality Gate Status](https://sonar.scoutinscience.com/api/project_badges/measure?project=great-ai&metric=alert_status)](https://sonar.scoutinscience.com/dashboard?id=great-ai) [![Publish on PyPI](https://github.com/ScoutinScience/great_ai/actions/workflows/publish.yaml/badge.svg)](https://github.com/ScoutinScience/great_ai/actions/workflows/publish.yaml) [![Publish on DockerHub](https://github.com/ScoutinScience/great_ai/actions/workflows/docker.yaml/badge.svg)](https://github.com/ScoutinScience/great_ai/actions/workflows/docker.yaml) + +## Find `great-ai` on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai) + +```sh +docker run -p6060:6060 schmelczera/great-ai +``` + +Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/). + + +## Find `great-ai` on [PyPI](https://pypi.org/project/great-ai/) + ```sh pip install great-ai ``` -Find it on [DockerHub](https://hub.docker.com/repository/docker/schmelczera/great-ai) -Find it on [PyPI](https://pypi.org/project/great-ai/) +```python +from great_ai import GreatAI -**work in progress, do not use!** +@GreatAI.create +def hello_world(name: str) -> str: + return f"Hello {name}!" +``` +> Create a new file called `main.py` + +Deploy by executing `python3 -m great-ai main.py` + +Find the dashboard at [http://localhost:6060](http://localhost:6060/dashboard/). diff --git a/docs/hello_world.py b/docs/hello_world.py new file mode 100644 index 0000000..1f6fd01 --- /dev/null +++ b/docs/hello_world.py @@ -0,0 +1,6 @@ +from great_ai import GreatAI + + +@GreatAI.create +def hello_world(name: str) -> str: + return f"Hello {name}!"