https://github.com/yangboz/hub-builder
Jina Hub Builder is an app for building UGC images, testing and pushing them to docker hub
https://github.com/yangboz/hub-builder
Last synced: 6 months ago
JSON representation
Jina Hub Builder is an app for building UGC images, testing and pushing them to docker hub
- Host: GitHub
- URL: https://github.com/yangboz/hub-builder
- Owner: yangboz
- License: apache-2.0
- Created: 2020-06-03T07:42:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-24T14:54:45.000Z (over 5 years ago)
- Last Synced: 2025-02-08T05:17:47.757Z (8 months ago)
- Homepage:
- Size: 4.96 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Jina Hub Builder (beta)
[](https://github.com/jina-ai/hub-builder/actions?query=workflow%3Aon-release)
[](https://github.com/jina-ai/hub-builder/actions?query=workflow%3Anightly)
[](https://hubstatus.jina.ai)
[](#license)
[](https://docs.jina.ai)
[](https://jobs.jina.ai)
![]()
Jina Hub Builder is an app for building user generated pod images, testing and publishing them on Docker Hub.

- [Installing dependencies](#installing-dependencies)
- [Building images](#building-images)
- [Flags:](#flags)
- [Outputs](#outputs)
- [Contributing](#contributing)
- [License](#license)## Installing dependencies
To build images with this builder app, first you have to install some required dependencies and repos.
```bash
β 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]
```## Building images
For building single image:
```bash
β python app.py --target=hub/examples/mwu_encoder
```For building all images:
```bash
β python app.py --update-strategy=force
```### Flags:
- [ ] `--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 as `DOCKERHUB_DEVBOT_USER` and `DOCKERHUB_DEVBOT_USER` as env variables are required.
- [ ] `--test`: to test images with `docker 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 to `force`, rebuilds all images. More detailed description regarding update policy [is here.](https://github.com/jina-ai/jina-hub#remarks-on-the-update-policy)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.](https://github.com/jina-ai/jina-hub#remarks-on-the-update-policy)## Outputs
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](https://github.com/jina-ai/api#jina-hub-status) for more details.## Contributing
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](https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md) before the submission.
## License
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.](LICENSE)