Skip to content

Commit 56868d3

Browse files
authored
Modify step image README.md (#2489)
1 parent e81457e commit 56868d3

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

docker/step/README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,27 @@
22

33
This image is used when submitting Argo workflows to run Tensorflow/PAI Tensorflow jobs. To build this image, you should follow the below steps:
44

5-
1. Run `docker run --rm -it -v $PWD:/opt/output sqlflow/sqlflow cp -r /usr/local/bin/step /opt/sqlflow/parser/parser-1.0-SNAPSHOT-jar-with-dependencies.jar /opt/output` to copy latest `step` and parser jar file.
6-
2. Copy `python/sqlflow_submitter` directory to this directory.
5+
1. Go to SQLFlow root directory
6+
```bash
7+
cd $(git rev-parse --show-toplevel)
8+
```
9+
1. Build the `sqlflow:dev` docker image as described [here](../dev/README.md), only needed when you haven't done it. For short, you can just execute below command:
10+
```bash
11+
docker build -t sqlflow:dev -f docker/dev/Dockerfile .
12+
```
13+
1. Run `sqlflow:dev` image to build SQLFlow project. This process will generate a directory called `build` under current directory which contains all the binaries we need.
14+
```bash
15+
docker run --rm -it \
16+
-v $GOPATH:/root/go \
17+
-v $HOME/.m2:/root/.m2 \
18+
-v $HOME/.cache:/root/.cache \
19+
-v $PWD:/work -w /work \
20+
sqlflow:dev
21+
```
22+
1. Run below command to build the `sqlflow:step` docker image. This command will package perviously built binaries into the result image.
23+
```bash
24+
docker build -t sqlflow:step -f docker/step/Dockerfile .
25+
```
726
8-
After above steps, we are expecting to have below files under the current directory before we can run `docker build`:
9-
10-
- step
11-
- parser-1.0-SNAPSHOT-jar-with-dependencies.jar
12-
- sqlflow_submitter/
13-
14-
Then run `docker build -t sqlflow_tensorflow_step:slim .`, and push this image to some registry that your Kubernetes cluster can reach. To use it in SQLFlow, specify the environment variable `export SQLFLOW_WORKFLOW_STEP_IMAGE=sqlflow_tensorflow_step:slim` to use this image as step image.
27+
To use it in SQLFlow, specify the environment variable `export SQLFLOW_WORKFLOW_STEP_IMAGE=sqlflow:step` when you start `sqlflow server`, or set the image in a Kubernetes config file, you can see an example [here](https://github.com/sql-machine-learning/sqlflow/blob/f5dc0209fe1bd71c443e82ebb4f6981b06e33542/doc/run/k8s/install-sqlflow.yaml#L16).
1528

0 commit comments

Comments
 (0)