Jina Hub Builder is an app for building user generated pod images, testing and publishing them on Docker Hub.
To build images with this builder app, first you have to install some required dependencies and repos.
➜ git clone https://github.com/jina-ai/hub-builder ./builder // installing the builder core
➜ git clone https://github.com/jina-ai/jina-hub ./builder/hub // installing hub containing current stable images
➜ git clone https://github.com/jina-ai/jina ./builder/src/jina // installing jina core
➜ git clone https://github.com/jina-ai/hub-status ./builder/status // installing status path
➜ cd builder
➜ pip install -r builder/requirements.txt
➜ pip install jina[devel]
For building single image:
➜ python app.py --target=hub/examples/mwu_encoder
For building all images:
➜ python app.py --update-strategy=force
-
--bleach-first
: to remove all existing docker instances before build -
--target
: is a path to single image to be builded -
--push
: to push successfully builded image to docker hub. Credentials asDOCKERHUB_DEVBOT_USER
andDOCKERHUB_DEVBOT_USER
as env variables are required. -
--test
: to test images withdocker run
,jina pod
, and Jina Flow. -
--reason
: to set a reason for current build (would be added to status readme) -
--check-targets
: to check if some images-related files were modified but with no rebuild -
--update-strategy
: is a level of current rebuild importance. If specified toforce
, rebuilds all images. More detailed description regarding update policy is here.
If you wish your Mongo database to track build history, you should add database connection on app call.
Execute MONGODB_CREDENTIALS={user:password} app.py ...
instead of using app.py ...
.
When you start the app, you may lines like this:
Found target file /Users/user/builder/hub/hub/executors/encoders/image/torchvision-mobilenet_v2/Dockerfile
This means the file was modified from it's last git-committed state.
All images having proper update
field specified in their manifest.yml
will be updated according to selected --update-strategy
on the app.py
run. More detailed description regarding update policy is here.
When the image build is finished, you will see message like
Successfully built image hub.executors.encoders.nlp.transformers-pytorch
This means you image is successfully built. Otherwise, you see an error description in your terminal output.
If you have --push
option on application run, all successfully built images will be pushed to docker hub.
When the app run is finished (only if you built multiple targets and did not specified --target
flag), you will see lines like
Hub readme updated successfully on path /Users/user/hub-builder/status/README.md
Hub badge updated successfully on path /Users/user/hub-builder/status/hub-stat.svg
This means the app has just updated status Readme.md and hub badge.
If you run the app with database connection (with MONGODB_CREDENTIALS
specified), you will see a message:
Hub history updated successfully on database
The next lines:
Package api updated on path /Users/user/hub-builder/api/hub/package
Status api updated on path /Users/user/hub-builder/api/hub/status
mean that the app produced fresh json tracks which could be used for status and building state analysis. See here for more details.
We welcome all kinds of contributions from the open-source community, individuals and partners. Without your active involvement, Jina won't be successful.
Please first read the contributing guidelines before the submission.
Copyright (c) 2020 Jina AI Limited. All rights reserved.
Jina is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.