Skip to content

Commit

Permalink
refactor: Dockerfile generation (#2473)
Browse files Browse the repository at this point in the history
* chore: remove docker manager

Signed-off-by: Aaron Pham <[email protected]>

* chore: add platforms detection dockerfile

Signed-off-by: Aaron Pham <[email protected]>

* chore: wip

Signed-off-by: Aaron Pham <[email protected]>

* feat(wip): add templates and skafold

Signed-off-by: Aaron Pham <[email protected]>

* chore: wip

Signed-off-by: Aaron Pham <[email protected]>

* chore: merge with runners-1.0

Signed-off-by: Aaron Pham <[email protected]>

* chore: add dependencies

Signed-off-by: Aaron Pham <[email protected]>

* feat: supports buildx for alpine bentos

Signed-off-by: Aaron Pham <[email protected]>

* feat: add alpine-miniconda

Signed-off-by: Aaron Pham <[email protected]>

* chore: wip refactor ugly code

Signed-off-by: Aaron Pham <[email protected]>

* chore: entrypoint for templates instead of per distros

Signed-off-by: Aaron Pham <[email protected]>

* feat: finish setting correct cuda dependencies per distro

Signed-off-by: Aaron Pham <[email protected]>

* chore: wip instruction set for cuda, need a break

Signed-off-by: Aaron Pham <[email protected]>

* feat: supports cuda type alias and v10.2.89\n\nnote: continue working on support cuda11

Signed-off-by: Aaron Pham <[email protected]>

* chore: add suports for CUDA11 and bashrc

Signed-off-by: Aaron Pham <[email protected]>

* chore: remove bashrc

Signed-off-by: Aaron Pham <[email protected]>

* fix: bash initialization for alpine

Signed-off-by: Aaron Pham <[email protected]>

* feat: cleanup and PR is finished

Signed-off-by: Aaron Pham <[email protected]>

* chore: wip

Signed-off-by: Aaron Pham <[email protected]>

* chore: wip

Signed-off-by: Aaron Pham <[email protected]>

* chore: init new templates

Signed-off-by: Aaron Pham <[email protected]>

* feat: support alpine

Signed-off-by: Aaron Pham <[email protected]>

* feat: amazonlinux supports 3.7 and 3.8

Signed-off-by: Aaron Pham <[email protected]>

* feat: supports all required images

Signed-off-by: Aaron Pham <[email protected]>

* chore: updates wip

Signed-off-by: Aaron Pham <[email protected]>

* feat(DockerOptions): supports parsigin envars as file

Signed-off-by: Aaron Pham <[email protected]>

* revert: cherry-pick docker frontend changes (will address in a different PR)

Signed-off-by: Aaron Pham <[email protected]>

* chore: apply sauyon reviews

Co-authored-by: Sauyon Lee <[email protected]>
Signed-off-by: Aaron Pham <[email protected]>

* chore(types): annotation for kwargs_transformers

Signed-off-by: Aaron Pham <[email protected]>

* chore: address some changes

Signed-off-by: Aaron Pham <[email protected]>

* chore: finish

Signed-off-by: Aaron Pham <[email protected]>

* chore: address type

chore: import TypeAlias for python < 3.10

Signed-off-by: Aaron Pham <[email protected]>

* chore: fix path

Signed-off-by: Aaron Pham <[email protected]>

* chore: enable buildkit for ubuntu only

Signed-off-by: Aaron Pham <[email protected]>

* Update bentoml/_internal/bento/build_config.py

Co-authored-by: Sauyon Lee <[email protected]>

* Update bentoml/_internal/bento/build_dev_bentoml_whl.py

Co-authored-by: Sauyon Lee <[email protected]>

* Update bentoml/_internal/bento/build_dev_bentoml_whl.py

Co-authored-by: Sauyon Lee <[email protected]>

* chore: address sauyon changes

Signed-off-by: Aaron Pham <[email protected]>

* chore: fix unit

Signed-off-by: Aaron Pham <[email protected]>

* chore: fix typo

Signed-off-by: Aaron Pham <[email protected]>

* Update bentoml/_internal/bento/build_config.py

* Update bentoml/_internal/bento/build_dev_bentoml_whl.py

* Update bentoml/_internal/bento/build_dev_bentoml_whl.py

* chore: add warnings

Signed-off-by: Aaron Pham <[email protected]>

* chore: fmt

Signed-off-by: Aaron Pham <[email protected]>

Co-authored-by: Sauyon Lee <[email protected]>
  • Loading branch information
aarnphm and sauyon authored May 27, 2022
1 parent a73e969 commit 3e9675f
Show file tree
Hide file tree
Showing 95 changed files with 1,146 additions and 4,621 deletions.
2 changes: 1 addition & 1 deletion .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. cc @bentoml/dev
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
closeComment: false
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- *related
- "bentoml/**"
- "tests/**"
- "docker/**"
docs:
- *related
- requirements/docs-requirements.txt
Expand Down Expand Up @@ -215,7 +214,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [ '3.7', '3.8', '3.9' ]
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
defaults:
run:
shell: bash
Expand All @@ -239,6 +238,14 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: ${{ matrix.os == 'ubuntu-latest' }}
- name: Set up Docker Buildx
if: ${{ matrix.os == 'ubuntu-latest' }}
id: buildx
uses: docker/setup-buildx-action@v2

- name: Get pip cache dir
id: cache-dir
run: |
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ It is possible to force a Bento to use a custom BentoML source distribution:
1. Install custom BentoML in editable mode. e.g.:
* git clone your bentoml fork
* `pip install -e PATH_TO_THE_FORK`
2. Set env var `export BENTOML_BUNDLE_LOCAL_BUILD=True`
2. Set env var `export BENTOML_BUNDLE_LOCAL_BUILD=True` and `export SETUPTOOLS_USE_DISTUTILS=stdlib`
* make sure you have the latest setuptools installed: `pip install -U setuptools`
3. Build a new Bento with `bentoml build` in your project directory
4. The new Bento will include a wheel file built from the BentoML source, and
Expand Down
9 changes: 3 additions & 6 deletions bentoml/_internal/bento/bento.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,9 @@ def create(
target_fs.makedirs(dir_path, recreate=True)
copy_file(ctx_fs, _path, target_fs, _path)

if build_config.docker:
build_config.docker.write_to_bento(bento_fs, build_ctx)
if build_config.python:
build_config.python.write_to_bento(bento_fs, build_ctx)
if build_config.conda:
build_config.conda.write_to_bento(bento_fs, build_ctx)
build_config.docker.write_to_bento(bento_fs, build_ctx, build_config.conda)
build_config.python.write_to_bento(bento_fs, build_ctx)
build_config.conda.write_to_bento(bento_fs, build_ctx)

# Create `readme.md` file
if build_config.description is None:
Expand Down
Loading

0 comments on commit 3e9675f

Please sign in to comment.