Skip to content

Commit

Permalink
feat: new docker image and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vagetablechicken committed Aug 21, 2023
1 parent 5d58b42 commit 1e35189
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Dockerfile
.metals/
.vscode/
# mount dataset, don't copy to image
dataset/*
*/target/
*logs/
61 changes: 61 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: FeBench Docker

on:
workflow_dispatch:
inputs:
VERSION:
description: 'FeBench image version'
required: true
default: '0.5.0'

env:
IMAGE_NAME: febench

jobs:
build-and-publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Decide Push
run: |
if [[ ${{ github.event_name }} = 'workflow_dispatch' ]]; then
echo "PUSH=true" >> $GITHUB_ENV
VERSION=${{ github.event.inputs.VERSION }}
DOCKERHUB_TAG=${{ secrets.DOCKERHUB_REPO }}/$IMAGE_NAME:$VERSION
DOCKERHUB_LATEST=${{ secrets.DOCKERHUB_REPO }}/$IMAGE_NAME:latest
echo "DockerHub Tag: $DOCKERHUB_TAG"
echo "COMMIT=${{ github.sha }}"
echo "DOCKERHUB_TAG=$DOCKERHUB_TAG" >> $GITHUB_ENV
echo "DOCKERHUB_LATEST=$DOCKERHUB_LATEST" >> $GITHUB_ENV
else
echo "PUSH=false" >> $GITHUB_ENV
fi
- name: Login to Docker Hub
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build And Push
id: docker_build
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: docker/build-push-action@v3
with:
context: demo
push: ${{ env.PUSH }}
platforms: linux/amd64
tags: |
${{ env.DOCKERHUB_TAG }}
${{ env.DOCKERHUB_LATEST }}
build-args: OPENMLDB_VERSION=${{ github.event.inputs.VERSION }}
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# copy openmldb package from
FROM 4pdosc/openmldb:0.8.2 AS builder

FROM openjdk:11.0.13-jdk-slim-bullseye
COPY --from=builder /work/openmldb /work/openmldb
# group name
LABEL org.opencontainers.image.authors="Huang Wei"
# TAG

# ignores in .dockerignore
COPY * /work/febench/
# febench use zk 7181
RUN sed -i'' 's/localhost:2181/localhost:7181/g' /work/openmldb/conf/hosts

# maven
RUN apt update && apt install -y vim maven

WORKDIR /work

CMD [ "/bin/bash" ]
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,28 +164,26 @@ We have included a comprehensive testing procedure in a docker for you to try.
1. Download docker image.

```bash
docker pull lucky20020327/febench:v2.0
docker pull vegatablechicken/febench:0.5.0
```

2. Run the image.

```bash
# note that you need download the data in advance and mount it into the container.
docker run -it -v <data path>:/home/febench/dataset <image id>
docker run -it -v <data path>:/work/febench/dataset <image id>
```

3. Enter the `env` directory and start the clusters.
3. Start the clusters, addr is `localhost:7181`, path is `/openmldb``.

```bash
cd /home/env/bin
./recover.sh
./start-all.sh
/work/init.sh
```

4. Enter `febench` directory and init the configuration.

```bash
cd /home/febench
cd /work/febench
export FEBENCH_ROOT=`pwd`
sed s#\<path\>#$FEBENCH_ROOT# ./OpenMLDB/conf/conf.properties.template > ./OpenMLDB/conf/conf.properties
sed s#\<path\>#$FEBENCH_ROOT# ./flink/conf/conf.properties.template > ./flink/conf/conf.properties
Expand Down

0 comments on commit 1e35189

Please sign in to comment.