Skip to content

Commit

Permalink
Add makefile for wheel building
Browse files Browse the repository at this point in the history
  • Loading branch information
TE-WangShi committed Apr 5, 2022
1 parent acff89a commit b6265a8
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
39 changes: 39 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2022 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

NNABLA_BROWSER_BUILD_ENV_DOCKER_IMAGE_NAME=nnabla-browser-build

DOCKER_BUILD_ARGS = --build-arg HTTP_PROXY=${http_proxy}
DOCKER_BUILD_ARGS += --build-arg HTTPS_PROXY=${https_proxy}
DOCKER_BUILD_ARGS += --build-arg http_proxy=${http_proxy}
DOCKER_BUILD_ARGS += --build-arg https_proxy=${https_proxy}

DOCKER_RUN_OPTS = --rm
DOCKER_RUN_OPTS += -v $$(pwd):$$(pwd)
DOCKER_RUN_OPTS += -w $$(pwd)
DOCKER_RUN_OPTS += -u $$(id -u):$$(id -g)
DOCKER_RUN_OPTS += -e http_proxy=${http_proxy}
DOCKER_RUN_OPTS += -e https_proxy=${https_proxy}

.PHONY:nnabla-browser-build-env
nnabla-browser-build-env:
docker build $(DOCKER_BUILD_ARGS) -f docker/development/Dockerfile.build -t $(NNABLA_BROWSER_BUILD_ENV_DOCKER_IMAGE_NAME) .

.PHONY:nnabla-browser-wheel
nnabla-browser-wheel:
python3 setup.py bdist_wheel

.PHONY:bwd-nnabla-browser-wheel
bwd-nnabla-browser-wheel:nnabla-browser-build-env
docker run $(DOCKER_RUN_OPTS) $(NNABLA_BROWSER_BUILD_ENV_DOCKER_IMAGE_NAME) make nnabla-browser-wheel
28 changes: 28 additions & 0 deletions docker/development/Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2022 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
make \
python3 \
python3-pip \
python-is-python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN pip install ${PIP_INS_OPTS} wheel setuptools nnabla

0 comments on commit b6265a8

Please sign in to comment.