Skip to content

Commit

Permalink
chore: fix missing deps in CI (#603)
Browse files Browse the repository at this point in the history
* chore: fix missing deps in CI

* fix Dockerfile

* add nightly docker image

* fix path
  • Loading branch information
jiacai2050 authored Feb 1, 2023
1 parent 1ab3b20 commit aa306ec
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker-build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/docker-build-image.yml'
- '.github/workflows/**'
- 'Dockerfile'
- 'docker/**'
- 'docs/minimal.toml'
push:
branches:
- main
paths:
- '.github/workflows/docker-build-image.yml'
- '.github/workflows/**'
- 'Dockerfile'
- 'docker/**'
- 'docs/minimal.toml'
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/dockerhub-publish-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Nightly Docker image

on:
workflow_dispatch:
schedule:
- cron: '10 20 * * *'

jobs:
docker:
if: github.repository_owner == 'CeresDB'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set datetime
run: |
echo "BUILD_DATE=$(TZ=':Asia/Shanghai' date '+%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Build and Push CeresDB Server Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ceresdb/ceresdb-server:nightly-${{ env.BUILD_DATE }}-${{ github.sha }}
9 changes: 6 additions & 3 deletions .github/workflows/tsbs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/tsbs.yml'
- '.github/workflows/**'
- 'scrits/run-tsbs.sh'
paths-ignore:
schedule:
Expand All @@ -31,13 +31,16 @@ jobs:
restore-keys: |
release-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}-
release-${{ runner.os }}-
release-${{ runner.os }}
- name: Ensure Disk Quota
run: |
make ensure-disk-quota
- name: Setup Build Environment
run: |
sudo apt update
sudo apt install --yes protobuf-compiler
- name: Build server
run: |
make build
make build-slim
- name: Run TSBS
run: |
./scripts/run-tsbs.sh
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ FROM rust:${RUST_VERSION}-slim-bullseye as build
# cache mounts below may already exist and owned by root
USER root

RUN apt update && apt install --yes gcc g++ libssl-dev pkg-config cmake && rm -rf /var/lib/apt/lists/*
RUN apt update && apt install --yes gcc g++ libssl-dev pkg-config cmake protobuf-compiler && rm -rf /var/lib/apt/lists/*

COPY . /ceresdb
WORKDIR /ceresdb

RUN make build
RUN make build-slim

## CeresDB
FROM ubuntu:20.04
Expand All @@ -23,7 +23,7 @@ RUN apt update && \

ENV RUST_BACKTRACE 1

COPY --from=build /ceresdb/target/release/ceresdb-server /usr/bin/ceresdb-server
COPY --from=build /ceresdb/target/release-slim/ceresdb-server /usr/bin/ceresdb-server
RUN chmod +x /usr/bin/ceresdb-server

COPY ./docker/entrypoint.sh /entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-tsbs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cleanup() {

mkdir -p ${LOG_DIR}

nohup ./target/release/ceresdb-server -c ${CONFIG_FILE} > ${LOG_DIR}/server.log &
nohup ./target/release-slim/ceresdb-server -c ${CONFIG_FILE} > ${LOG_DIR}/server.log &

git clone -b feat-ceresdb --depth 1 --single-branch https://github.com/CeresDB/tsbs.git

Expand Down

0 comments on commit aa306ec

Please sign in to comment.