Skip to content

Commit

Permalink
ci: add model-ci.yml (#15)
Browse files Browse the repository at this point in the history
* Split models/fasttext
  • Loading branch information
peaceiris authored Sep 27, 2020
1 parent 3017beb commit 138fc11
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 27 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/model-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Model CI'

on:
schedule:
- cron: '22 22 * * *'
push:
branches:
- main
paths:
- '.github/workflows/model-ci.yml'
- 'models/**'
- '!*.md'
pull_request:
paths:
- '.github/workflows/model-ci.yml'
- 'models/**'
- '!*.md'

jobs:
fasttext:
runs-on: ubuntu-18.04
defaults:
run:
working-directory: models/fasttext
steps:
- uses: actions/checkout@v2.3.2
- name: Login to Packages
run: echo '${{ secrets.GITHUB_TOKEN }}' | docker login 'docker.pkg.github.com' -u 'peaceiris' --password-stdin
- run: docker-compose pull --quiet
if: github.event_name == 'pull_request'
- run: make build
- run: docker images
# - run: make fmt
# - run: make lint
# - run: make test
- run: docker-compose push
if: github.ref == 'refs/heads/main'
2 changes: 1 addition & 1 deletion models/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.ACCESS_TOKEN
*.txt
!requirements.txt
suggestions.json
training_data/
fasttext/try-suggest.ts
11 changes: 0 additions & 11 deletions models/Makefile

This file was deleted.

13 changes: 0 additions & 13 deletions models/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*

- [Models](#models)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Models

```sh
make build
make run
```
3 changes: 3 additions & 0 deletions models/doc2vec/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.*
*
!requirements.txt
2 changes: 1 addition & 1 deletion models/Dockerfile → models/doc2vec/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.5-slim-buster
FROM python:3.8-slim-buster

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
Expand Down
11 changes: 11 additions & 0 deletions models/doc2vec/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
IMAGE_NAME := docker.pkg.github.com/peaceiris/actions-suggest-related-links/asrl-doc2vec:latest

.PHONY: build
build:
# docker-compose build
docker build -t ${IMAGE_NAME} .

.PHONY: run
run:
# docker-compose run --rm dev bash
docker run --rm -i -t -v ${PWD}:/src ${IMAGE_NAME} bash
27 changes: 27 additions & 0 deletions models/doc2vec/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
beautifulsoup4==4.9.1
boto==2.49.0
boto3==1.14.55
botocore==1.17.55
bs4==0.0.1
certifi==2020.6.20
chardet==3.0.4
Deprecated==1.2.10
docutils==0.15.2
fasttext==0.9.2
gensim==3.8.3
idna==2.10
jmespath==0.10.0
Markdown==3.2.2
numpy==1.19.1
pybind11==2.5.0
PyGithub==1.53
PyJWT==1.7.1
python-dateutil==2.8.1
requests==2.24.0
s3transfer==0.3.3
scipy==1.5.2
six==1.15.0
smart-open==2.1.1
soupsieve==2.0.1
urllib3==1.25.10
wrapt==1.12.1
3 changes: 3 additions & 0 deletions models/fasttext/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.*
*
!requirements.txt
18 changes: 18 additions & 0 deletions models/fasttext/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM python:3.8-slim-buster

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential && \
apt-get autoclean && \
apt-get clean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

WORKDIR /build
ENV PIP_NO_CACHE_DIR="true"
COPY requirements.txt requirements.txt
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install -r ./requirements.txt && \
python3 -m pip check && \
rm -rf /build

WORKDIR /src
7 changes: 7 additions & 0 deletions models/fasttext/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: build
build:
docker-compose build

.PHONY: run
run:
docker-compose run --rm dev bash
13 changes: 13 additions & 0 deletions models/fasttext/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'

services:
dev:
build: .
image: docker.pkg.github.com/peaceiris/actions-suggest-related-links/asrl-fasttext:latest
container_name: asrl_fasttext
volumes:
- ${PWD}:/src
stdin_open: true
tty: true
command:
- bash
3 changes: 3 additions & 0 deletions models/fasttext/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fasttext==0.9.2
numpy==1.19.2
pybind11==2.5.0
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"prettier --check",
"eslint"
],
"README.md": [
"/README.md": [
"npx doctoc@1.4.0 --github"
]
},
Expand Down

0 comments on commit 138fc11

Please sign in to comment.