-
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.
- Loading branch information
Showing
9 changed files
with
139 additions
and
91 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,2 @@ | ||
/test_data | ||
/target |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
ff_fasttext/*.so | ||
__pycache__ | ||
*.egg-info | ||
/taxonomy.json |
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 |
---|---|---|
@@ -1,13 +1,35 @@ | ||
# You can override the included template(s) by including variable overrides | ||
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings | ||
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings | ||
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings | ||
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings | ||
# Note that environment variables can be set in several places | ||
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence | ||
# https://docs.openfaas.com/reference/cicd/gitlab/ | ||
|
||
variables: | ||
CONTAINER_TAG_IMAGE: $CI_REGISTRY_IMAGE:build-$CI_BUILD_REF_NAME | ||
CONTAINER_IMAGE: $CI_REGISTRY_IMAGE:build-$CI_PIPELINE_ID | ||
CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest | ||
DOCKER_DRIVER: overlay | ||
DOCKER_HOST: tcp://localhost:2375/ | ||
|
||
|
||
services: | ||
- docker:18.09.7-dind | ||
|
||
before_script: | ||
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com | ||
|
||
stages: | ||
- test | ||
sast: | ||
stage: test | ||
include: | ||
- template: Security/SAST.gitlab-ci.yml | ||
- build | ||
- deploy | ||
|
||
# Cache the templates and build-context to speed things up | ||
cache: | ||
key: ${CI_COMMIT_REF_SLUG} # i.e. master | ||
paths: | ||
- ./faas-cli | ||
- ./template | ||
|
||
# Build the whole stack using only the faas-cli | ||
build: | ||
script: | ||
- docker build -f Dockerfile -t $CONTAINER_IMAGE . | ||
- docker push $CONTAINER_IMAGE | ||
- docker tag $CONTAINER_IMAGE $CONTAINER_TAG_IMAGE && docker push $CONTAINER_TAG_IMAGE | ||
only: | ||
- main |
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,52 @@ | ||
FROM rust as rust_build | ||
|
||
RUN mkdir -p /app/build/ff_fasttext | ||
RUN mkdir -p /app/build/test_data | ||
WORKDIR /app/build/test_data | ||
RUN curl -L -O "http://www.sfs.uni-tuebingen.de/a3-public-data/finalfusion-fasttext/wiki/wiki.en.fifu" | ||
WORKDIR /app/build | ||
|
||
COPY Cargo.lock /app/build | ||
COPY Cargo.toml /app/build | ||
|
||
RUN apt-get update && apt-get install -y python3-pip liblapack-dev libatlas-base-dev | ||
|
||
RUN RUSTFLAGS="-C link-args=-lcblas -llapack" cargo install finalfusion-utils --features=opq | ||
|
||
COPY setup.py /app/build | ||
COPY setup.cfg /app/build | ||
COPY pyproject.toml /app/build | ||
COPY poetry.lock /app/build | ||
COPY requirements-dev.txt /app/build | ||
COPY src /app/build/src | ||
COPY ff_fasttext/__init__.py /app/build/ff_fasttext | ||
|
||
WORKDIR /app/build | ||
|
||
RUN pip install --no-cache-dir --upgrade -r requirements-dev.txt | ||
|
||
RUN python3 setup.py develop | ||
|
||
FROM python:3-bullseye | ||
|
||
RUN mkdir -p /app/ff_fasttext | ||
|
||
COPY --from=rust_build /app/build/ff_fasttext/_ff_fasttext.abi3.so /app/ff_fasttext | ||
COPY --from=rust_build /app/build/test_data /app/test_data | ||
|
||
RUN pip install poetry | ||
WORKDIR /app | ||
|
||
COPY setup.py /app | ||
COPY setup.cfg /app | ||
COPY pyproject.toml /app | ||
COPY poetry.lock /app | ||
COPY requirements-dev.txt /app | ||
COPY ff_fasttext /app/ff_fasttext | ||
# COPY taxonomy.json /app | ||
|
||
WORKDIR /app | ||
|
||
RUN poetry install | ||
|
||
CMD ["poetry", "run", "uvicorn", "ff_fasttext.server:app", "--host", "0.0.0.0", "--port", "80"] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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