Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions doc/run/k8s/install-sqlflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,33 @@ spec:
- /work/mysql-inited
initialDelaySeconds: 5
periodSeconds: 5
- name: model-zoo
image: sqlflow/sqlflow:model_zoo
imagePullPolicy: IfNotPresent
ports:
- containerPort: 50055
protocol: TCP
env:
- name: MYSQL_ADDR
value: 127.0.0.1:3306
volumeMounts:
# bind to host's docker.sock to build image
- mountPath: /var/run/docker.sock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the model zoo server runs in k8s, it will use kaniko to build image automatically.

Copy link
Collaborator Author

@lhw362950217 lhw362950217 Jul 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This config is for single-user playground only. Using local docker is to avoid introducing new image dependency and keep the vm small.

And, thanks, I will use the kaniko way in our cloud playground.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

name: docker-socket-volume
securityContext:
privileged: true
command: [ "/bin/bash", "-c" ]
args:
- |
while ! nc -z -w 1 ${MYSQL_ADDR/:/ }; do
sleep 3
echo "Waiting for mysql..."
done
echo "Starting SQLFlow Model Zoo server ..."
modelzooserver --mysql-addr="mysql://root:root@tcp(${MYSQL_ADDR})/"
volumes:
- name: docker-socket-volume
hostPath:
path: /var/run/docker.sock
type: File