Skip to content

Commit 5c3dbdc

Browse files
authored
Release version (#470)
* Upgrade version. * New api-routes release. * Adding the workflows. * CHnage the name. * Adding the missing test. * Dash vs underscore war. * Wrong name * Fix version.
1 parent 79e3e17 commit 5c3dbdc

File tree

5 files changed

+81
-2
lines changed

5 files changed

+81
-2
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: latent-to-image-docker-cd
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- "docker_images/latent-to-image/**"
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Set up Python ${{ matrix.python-version }}
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.8"
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v1
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
- name: Install dependencies
23+
run: |
24+
pip install --upgrade pip
25+
pip install awscli
26+
- uses: huggingface/tailscale-action@v1
27+
with:
28+
authkey: ${{ secrets.TAILSCALE_AUTHKEY }}
29+
- name: Update upstream
30+
env:
31+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
32+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
33+
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
34+
DEFAULT_HOSTNAME: ${{ secrets.DEFAULT_HOSTNAME }}
35+
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
36+
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
37+
run: |
38+
python build_docker.py latent-to-image --out out.txt
39+
- name: Deploy on API
40+
run: |
41+
# Load the tags into the env
42+
cat out.txt >> $GITHUB_ENV
43+
export $(xargs < out.txt)
44+
echo ${LATENT_TO_IMAGE_CPU_TAG}
45+
# Weird single quote escape mechanism because string interpolation does
46+
# not work on single quote in bash
47+
curl -H "Authorization: Bearer ${{ secrets.API_GITHUB_TOKEN }}" https://api.github.com/repos/huggingface/api-inference/actions/workflows/update_community.yaml/dispatches -d '{"ref":"main","inputs":{"framework":"LATENT_TO_IMAGE","tag": "'"${LATENT_TO_IMAGE_CPU_TAG}"'"}}'
48+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# TODO: Merge this with allenNLP to have a single workflow for all docker images.
2+
name: latent-to-image-docker
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- "docker_images/latent-to-image/**"
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Set up Python ${{ matrix.python-version }}
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: "3.8"
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v1
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v1
22+
- name: Install dependencies
23+
run: |
24+
pip install --upgrade pip
25+
pip install pytest pillow httpx
26+
pip install -e .
27+
- run: RUN_DOCKER_TESTS=1 pytest -sv tests/test_dockers.py::DockerImageTests::test_latent_to_image

docker_images/latent-to-image/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
starlette
2-
api-inference-community
2+
api-inference-community>=0.0.37
33
diffusers
44
transformers
55
accelerate

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
setup(
55
name="api_inference_community",
6-
version="0.0.36",
6+
version="0.0.37",
77
description="A package with helper tools to build an API Inference docker app for Hugging Face API inference using huggingface_hub",
88
long_description=open("README.md", "r", encoding="utf-8").read(),
99
long_description_content_type="text/markdown",

tests/test_dockers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ def test_sentence_transformers(self):
136136
)
137137
self.framework_invalid_test("sentence_transformers")
138138

139+
def test_latent_to_image(self):
140+
# TODO add working examples.
141+
self.framework_invalid_test("latent-to-image")
142+
139143
def test_adapter_transformers(self):
140144
self.framework_docker_test(
141145
"adapter_transformers",

0 commit comments

Comments
 (0)