Skip to content

Commit d70311f

Browse files
Setup the directory structure for elasticdl_client. (#2048)
* Add the setup and requirements for elasticdl_client * Fix issues in setup file * Add __init__.py * Exclude elasticdl_client from main package. * Add the elasticdl_client pip package build and installation in travis ci and Dockerfile.
1 parent 671b85d commit d70311f

File tree

7 files changed

+81
-3
lines changed

7 files changed

+81
-3
lines changed

elasticdl/docker/Dockerfile.ci

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ RUN python -m pip install --quiet /elasticdl_preprocessing-develop-py3-none-any.
3939
--extra-index-url=${EXTRA_PYPI_INDEX} \
4040
&& rm /elasticdl_preprocessing-develop-py3-none-any.whl
4141

42+
# Install elasticdl_client package
43+
COPY build/elasticdl_client-develop-py3-none-any.whl /
44+
RUN python -m pip install --quiet /elasticdl_client-develop-py3-none-any.whl \
45+
--extra-index-url=${EXTRA_PYPI_INDEX} \
46+
&& rm /elasticdl_client-develop-py3-none-any.whl
47+
4248
# Install elasticdl package
4349
COPY build/elasticdl-develop-py3-none-any.whl /
4450
RUN python -m pip install --quiet /elasticdl-develop-py3-none-any.whl \

elasticdl_client/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2020 The ElasticDL Authors. All rights reserved.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.

elasticdl_client/main.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright 2020 The ElasticDL Authors. All rights reserved.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
15+
def main():
16+
pass
17+
18+
19+
if __name__ == "__main__":
20+
main()

elasticdl_client/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
kubernetes==10.1.0
2+
docker

scripts/build_and_test.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,14 @@ pytest elasticdl/python/tests elasticdl_preprocessing/tests --cov=elasticdl/pyth
4343
mkdir -p ./build
4444
mv coverage.xml ./build
4545

46+
# Create elasticdl_preprocessing package
47+
rm -rf ./build/lib
48+
python setup_preprocessing.py --quiet bdist_wheel --dist-dir ./build
49+
# Create elasticdl_client package
50+
rm -rf ./build/lib
51+
python setup_client.py --quiet bdist_wheel --dist-dir ./build
4652
# Create elasticdl package
4753
mkdir -p ./elasticdl/go/bin
4854
cp /tmp/elasticdl_ps ./elasticdl/go/bin/
4955
rm -rf ./build/lib
5056
python setup.py --quiet bdist_wheel --dist-dir ./build
51-
rm -rf ./build/lib
52-
python setup_preprocessing.py --quiet bdist_wheel --dist-dir ./build

setup.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@
3535
extras_require=extras,
3636
python_requires=">=3.5",
3737
packages=find_packages(
38-
exclude=["*test*", "elasticdl_preprocessing*", "model_zoo*"]
38+
exclude=[
39+
"*test*",
40+
"elasticdl_client*",
41+
"elasticdl_preprocessing*",
42+
"model_zoo*",
43+
]
3944
),
4045
package_data={
4146
"": [

setup_client.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright 2020 The ElasticDL Authors. All rights reserved.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
from setuptools import find_packages, setup
15+
16+
with open("elasticdl_client/requirements.txt") as f:
17+
required_deps = f.read().splitlines()
18+
19+
setup(
20+
name="elasticdl_client",
21+
version="develop",
22+
description="The client tool for ElasticDL.",
23+
author="Ant Financial",
24+
url="https://elasticdl.org",
25+
install_requires=required_deps,
26+
python_requires=">=3.5",
27+
packages=find_packages(include=["elasticdl_client*"]),
28+
package_data={"": ["requirements.txt"]},
29+
)

0 commit comments

Comments
 (0)