Skip to content

Commit

Permalink
Dockerize URIDrain and pipeline (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Superskyyy authored Jun 20, 2023
1 parent 3ac2a25 commit a8c5aeb
Show file tree
Hide file tree
Showing 13 changed files with 76 additions and 3,151 deletions.
16 changes: 16 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2023 SkyAPM org
#
# 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.

*venv*
.github
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright 2023 SkyAPM org
#
# 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.

# Stage 1: Builder stage with full Python image
FROM python:3.11-slim as final

ENV PYTHONUNBUFFERED=1

WORKDIR /app

# Copy the necessary files into the container
COPY . /app

# Build the project with make
RUN python3 -m pip install grpcio-tools packaging \
&& python3 -m tools.grpc_gen \
&& python3 -m pip install .[all]


# Expose the gRPC service port
EXPOSE 17128

# Set the entrypoint to run the gRPC service
ENTRYPOINT ["python", "-m", "servers.simple.run"]
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ else
poetry self update || $(MAKE) poetry-fallback
endif

.PHONY: gen-basic
gen-basic:
python3 -m pip install grpcio-tools packaging
python3 -m tools.grpc_gen

.PHONY: install
install: gen-basic
python3 -m pip install --upgrade pip
Expand Down
19 changes: 17 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,27 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
]


packages = [
{ include = "servers" },
{ include = "models" }
]

# poetry will ignore generated files as .gitignore, but we need them in package
include = ['servers/protos/**/*']
exclude = ['tests']


[tool.poetry.urls]
"Issues Tracker" = "https://github.com/apache/skywalking/issues"
"Documentation" = "TBD"

[tool.poetry.scripts]
# entry point for the CLI

[tool.poetry.build]
generate-setup-file = true

[tool.poetry.dependencies]
python = ">=3.8,<3.12" # Gradio needs 3.8+
grpcio = "*"
Expand All @@ -49,6 +63,7 @@ inflect = "^6.0.4"
pytest = "^7.3.2"



[tool.poetry.dev-dependencies]
#PySnooper = "^1.1.1"
## TESTING
Expand Down Expand Up @@ -78,5 +93,5 @@ flake8-2020 = "^1.7.0"
gradio = "^3.35.2"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
6 changes: 0 additions & 6 deletions server/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions server/__init__.py

This file was deleted.

63 changes: 0 additions & 63 deletions server/proto/ai_http_uri_recognition.proto

This file was deleted.

51 changes: 0 additions & 51 deletions server/proto/google/protobuf/empty.proto

This file was deleted.

Loading

0 comments on commit a8c5aeb

Please sign in to comment.