2021-11-29 14:10:53 +00:00
|
|
|
---
|
2020-11-26 13:38:27 +00:00
|
|
|
# CI Overview
|
|
|
|
# -----------
|
|
|
|
#
|
|
|
|
# Each night:
|
|
|
|
#
|
|
|
|
# A build image is created (ci_image) from `docker/Dockerfile.ci` and is
|
|
|
|
# pushed to `quay.io/influxdb/rust:ci`. This build image is then used to run
|
|
|
|
# the CI tasks for the day.
|
|
|
|
#
|
2021-11-05 18:06:30 +00:00
|
|
|
# Every commit:
|
2020-11-26 13:38:27 +00:00
|
|
|
#
|
2021-11-05 18:06:30 +00:00
|
|
|
# The CI for every PR and merge to main runs tests, fmt, lints and compiles debug binaries
|
2020-11-26 16:38:57 +00:00
|
|
|
#
|
2021-11-05 18:06:30 +00:00
|
|
|
# On main if all these checks pass it will then additionally compile in "release" mode and
|
2021-11-08 10:18:53 +00:00
|
|
|
# publish a docker image to quay.io/influxdb/iox:$COMMIT_SHA
|
2021-11-05 18:06:30 +00:00
|
|
|
#
|
|
|
|
# Manual CI Image:
|
|
|
|
#
|
|
|
|
# It is possible to manually trigger a rebuild of the image used in CI. To do this, navigate to
|
|
|
|
# https://app.circleci.com/pipelines/github/influxdata/influxdb_iox?branch=main (overriding the
|
|
|
|
# branch name if desired). Then:
|
|
|
|
# - Click "Run Pipeline" in the top-right
|
|
|
|
# - Expand "Add Parameters"
|
|
|
|
# - Add a "boolean" parameter called "ci_image" with the value true
|
|
|
|
# - Click "Run Pipeline"
|
|
|
|
#
|
|
|
|
# If you refresh the page you should see a newly running ci_image workflow
|
2021-03-29 16:55:50 +00:00
|
|
|
#
|
2020-11-26 13:38:27 +00:00
|
|
|
|
2020-02-07 15:39:31 +00:00
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
commands:
|
2021-04-20 19:29:14 +00:00
|
|
|
rust_components:
|
2021-06-23 18:30:31 +00:00
|
|
|
description: Verify installed components
|
2021-04-20 15:17:05 +00:00
|
|
|
steps:
|
|
|
|
- run:
|
2021-06-23 18:30:31 +00:00
|
|
|
name: Verify installed components
|
|
|
|
command: |
|
2021-08-17 10:09:18 +00:00
|
|
|
rustup --version
|
|
|
|
rustup show
|
|
|
|
cargo fmt --version
|
|
|
|
cargo clippy --version
|
2021-11-19 16:05:34 +00:00
|
|
|
cargo install cargo-hakari && cargo hakari --version
|
2021-04-20 19:29:14 +00:00
|
|
|
|
2021-03-29 16:55:50 +00:00
|
|
|
cache_restore:
|
|
|
|
description: Restore Cargo Cache
|
|
|
|
steps:
|
|
|
|
- restore_cache:
|
|
|
|
name: Restoring Cargo Cache
|
|
|
|
keys:
|
|
|
|
- cargo-cache-{{ arch }}-{{ .Branch }}-{{ checksum "Cargo.lock" }}
|
|
|
|
- cargo-cache-{{ arch }}-{{ .Branch }}
|
|
|
|
- cargo-cache
|
|
|
|
cache_save:
|
|
|
|
description: Save Cargo Cache
|
|
|
|
steps:
|
|
|
|
- save_cache:
|
|
|
|
name: Save Cargo Cache
|
|
|
|
paths:
|
|
|
|
- /usr/local/cargo/registry
|
|
|
|
key: cargo-cache-{{ arch }}-{{ .Branch }}-{{ checksum "Cargo.lock" }}
|
2020-06-05 21:45:44 +00:00
|
|
|
|
2020-02-07 15:39:31 +00:00
|
|
|
jobs:
|
|
|
|
fmt:
|
|
|
|
docker:
|
2020-05-28 01:25:57 +00:00
|
|
|
- image: quay.io/influxdb/rust:ci
|
2021-03-29 16:55:50 +00:00
|
|
|
environment:
|
2021-08-17 10:09:18 +00:00
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
2020-02-07 15:39:31 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2021-04-20 19:29:14 +00:00
|
|
|
- rust_components
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_restore
|
2020-02-07 15:39:31 +00:00
|
|
|
- run:
|
|
|
|
name: Rust fmt
|
2020-02-14 13:01:39 +00:00
|
|
|
command: cargo fmt --all -- --check
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_save
|
2020-02-07 15:39:31 +00:00
|
|
|
lint:
|
|
|
|
docker:
|
2020-05-28 01:25:57 +00:00
|
|
|
- image: quay.io/influxdb/rust:ci
|
2021-03-29 16:55:50 +00:00
|
|
|
environment:
|
2021-08-17 10:09:18 +00:00
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
2020-02-07 15:39:31 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2021-04-20 19:29:14 +00:00
|
|
|
- rust_components
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_restore
|
2020-02-07 15:39:31 +00:00
|
|
|
- run:
|
|
|
|
name: Clippy
|
2021-11-11 09:48:21 +00:00
|
|
|
command: cargo clippy --all-targets --all-features --workspace -- -D warnings
|
2021-11-29 14:11:05 +00:00
|
|
|
- run:
|
|
|
|
name: Shellcheck
|
|
|
|
command: find scripts -type f ! \( -iname '*.py' -or -iname '*.supp' \) -exec shellcheck {} +
|
2021-11-29 14:10:53 +00:00
|
|
|
- run:
|
|
|
|
name: Yamllint
|
|
|
|
command: yamllint --strict .
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_save
|
2021-09-21 09:01:30 +00:00
|
|
|
cargo_audit:
|
|
|
|
docker:
|
|
|
|
- image: quay.io/influxdb/rust:ci
|
|
|
|
environment:
|
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- rust_components
|
|
|
|
- cache_restore
|
|
|
|
- run:
|
|
|
|
name: Install Cargo Audit
|
|
|
|
command: cargo install --force cargo-audit
|
|
|
|
- run:
|
|
|
|
name: Cargo Audit
|
|
|
|
command: cargo audit
|
|
|
|
- cache_save
|
2021-04-27 10:54:33 +00:00
|
|
|
doc:
|
|
|
|
docker:
|
|
|
|
- image: quay.io/influxdb/rust:ci
|
|
|
|
environment:
|
2021-08-17 10:09:18 +00:00
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
2021-04-27 10:54:33 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- rust_components
|
|
|
|
- cache_restore
|
|
|
|
- run:
|
|
|
|
name: Cargo doc
|
2021-06-22 22:02:05 +00:00
|
|
|
# excluding datafusion because it's effectively a dependency masqueraded as workspace crate.
|
|
|
|
command: cargo doc --document-private-items --no-deps --workspace --exclude datafusion
|
2021-04-27 10:54:33 +00:00
|
|
|
- cache_save
|
2021-10-19 09:03:24 +00:00
|
|
|
- run:
|
|
|
|
name: Compress Docs
|
|
|
|
command: tar -cvzf rustdoc.tar.gz target/doc/
|
2021-06-22 22:02:05 +00:00
|
|
|
- store_artifacts:
|
2021-10-19 09:03:24 +00:00
|
|
|
path: rustdoc.tar.gz
|
2021-11-19 16:05:34 +00:00
|
|
|
workspace_hack_checks:
|
|
|
|
docker:
|
|
|
|
- image: quay.io/influxdb/rust:ci
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- rust_components
|
|
|
|
- cache_restore
|
|
|
|
- run:
|
|
|
|
name: Check that the workspace hack crate contains all features in use
|
2021-11-22 16:14:03 +00:00
|
|
|
command: cargo hakari generate --diff || echo "If this fails, fix it by running \`cargo hakari generate\` locally and committing the changes"
|
2021-11-19 16:05:34 +00:00
|
|
|
- run:
|
|
|
|
name: Check that all crates in the workspace depend on the workspace hack crate
|
2021-11-22 16:14:03 +00:00
|
|
|
command: cargo hakari manage-deps --dry-run || echo "If this fails, fix it by running \`cargo hakari manage-deps\` locally and committing the changes"
|
2021-07-09 11:38:30 +00:00
|
|
|
|
2020-02-07 15:39:31 +00:00
|
|
|
test:
|
|
|
|
docker:
|
2020-05-28 01:25:57 +00:00
|
|
|
- image: quay.io/influxdb/rust:ci
|
2021-11-29 14:10:53 +00:00
|
|
|
resource_class: xlarge # use of a smaller executor tends crashes on link
|
2021-03-29 16:55:50 +00:00
|
|
|
environment:
|
2021-08-17 10:09:18 +00:00
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
|
|
|
RUST_BACKTRACE: "1"
|
2021-11-10 16:48:16 +00:00
|
|
|
# Run integration tests
|
|
|
|
TEST_INTEGRATION: 1
|
|
|
|
INFLUXDB_IOX_INTEGRATION_LOCAL: 1
|
|
|
|
KAFKA_CONNECT: "localhost:9092"
|
2020-02-07 15:39:31 +00:00
|
|
|
steps:
|
2021-11-10 16:48:16 +00:00
|
|
|
- run:
|
|
|
|
name: Run Kafka
|
|
|
|
# Sudo needed because data directory owned by root but container runs as unprivileged user
|
2021-12-03 20:57:37 +00:00
|
|
|
command: sudo /opt/redpanda/bin/redpanda --redpanda-cfg /etc/redpanda/redpanda.yaml --overprovisioned --smp 1 --memory 1G --reserve-memory 0M
|
2021-11-10 16:48:16 +00:00
|
|
|
background: true
|
2020-02-07 15:39:31 +00:00
|
|
|
- checkout
|
2021-04-20 19:29:14 +00:00
|
|
|
- rust_components
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_restore
|
2020-02-07 15:39:31 +00:00
|
|
|
- run:
|
|
|
|
name: Cargo test
|
2021-09-22 17:30:37 +00:00
|
|
|
command: cargo test --workspace
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_save
|
|
|
|
|
2021-08-13 13:20:08 +00:00
|
|
|
# end to end tests with Heappy (heap profiling enabled)
|
|
|
|
test_heappy:
|
|
|
|
docker:
|
|
|
|
- image: quay.io/influxdb/rust:ci
|
2021-11-29 14:10:53 +00:00
|
|
|
resource_class: xlarge # use of a smaller executor tends crashes on link
|
2021-08-13 13:20:08 +00:00
|
|
|
environment:
|
2021-08-17 10:09:18 +00:00
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
|
|
|
RUST_BACKTRACE: "1"
|
2021-08-13 13:20:08 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- rust_components
|
|
|
|
- cache_restore
|
|
|
|
- run:
|
|
|
|
name: End to end tests (with heappy)
|
2021-08-19 16:36:14 +00:00
|
|
|
command: cargo test --no-default-features --features=heappy end_to_end
|
2021-08-13 13:20:08 +00:00
|
|
|
- cache_save
|
|
|
|
|
2021-09-09 14:24:24 +00:00
|
|
|
test_perf:
|
|
|
|
machine:
|
|
|
|
image: ubuntu-2004:202107-02
|
|
|
|
resource_class: xlarge
|
2021-09-13 23:11:59 +00:00
|
|
|
environment:
|
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
|
|
|
RUST_BACKTRACE: "1"
|
2021-09-09 14:24:24 +00:00
|
|
|
steps:
|
|
|
|
- run: sudo apt update
|
|
|
|
- run:
|
|
|
|
name: Install required compile tools
|
|
|
|
command: sudo apt install curl clang lld pkg-config libssl-dev --yes --no-install-recommends
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
- run:
|
2021-09-10 16:28:09 +00:00
|
|
|
name: Install rustup
|
|
|
|
command: scripts/install_rustup.sh
|
2021-09-09 14:24:24 +00:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Install perf.py dependencies
|
|
|
|
command: python3 -m pip install -r perf/requirements.txt
|
|
|
|
|
|
|
|
- restore_cache:
|
|
|
|
keys:
|
|
|
|
- cargo-lock-{{ checksum "Cargo.lock" }}
|
|
|
|
- run:
|
|
|
|
name: Prime Rust build cache
|
2021-09-13 23:11:59 +00:00
|
|
|
command: cargo build --package influxdb_iox --bin influxdb_iox --package iox_data_generator --bin iox_data_generator
|
2021-09-09 14:24:24 +00:00
|
|
|
- save_cache:
|
|
|
|
key: cargo-lock-{{ checksum "Cargo.lock" }}
|
|
|
|
paths:
|
|
|
|
- target
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: Run basic perf test to ensure that perf.py works
|
2021-11-05 11:09:33 +00:00
|
|
|
command: |
|
|
|
|
trap "cat perf/logs/test.log" ERR
|
|
|
|
perf/perf.py --debug --no-volumes --object-store memory battery-0
|
2021-09-09 14:24:24 +00:00
|
|
|
|
2020-11-26 13:38:27 +00:00
|
|
|
# Build a dev binary.
|
|
|
|
#
|
|
|
|
# Compiles a binary with the default ("dev") cargo profile from the iox source
|
|
|
|
# using the latest ci_image.
|
2020-02-07 15:39:31 +00:00
|
|
|
build:
|
|
|
|
docker:
|
2020-05-28 01:25:57 +00:00
|
|
|
- image: quay.io/influxdb/rust:ci
|
2021-11-29 14:10:53 +00:00
|
|
|
resource_class: xlarge # use of a smaller executor tends crashes on link
|
2021-03-29 16:55:50 +00:00
|
|
|
environment:
|
2021-08-17 10:09:18 +00:00
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# Disable full debug symbol generation to speed up CI build
|
|
|
|
# "1" means line tables only, which is useful for panic tracebacks.
|
|
|
|
RUSTFLAGS: "-C debuginfo=1"
|
2020-02-07 15:39:31 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2021-04-20 19:29:14 +00:00
|
|
|
- rust_components
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_restore
|
2020-02-07 15:39:31 +00:00
|
|
|
- run:
|
|
|
|
name: Cargo build
|
2020-05-08 14:24:01 +00:00
|
|
|
command: cargo build --workspace
|
2021-03-29 16:55:50 +00:00
|
|
|
- run:
|
|
|
|
name: Build benches
|
|
|
|
command: cargo test --workspace --benches --no-run
|
2021-07-09 11:38:30 +00:00
|
|
|
- run:
|
2021-08-13 13:11:32 +00:00
|
|
|
name: Build with object store + exporter support + HEAP profiling
|
2021-09-22 17:30:37 +00:00
|
|
|
command: cargo build --no-default-features --features="aws,gcp,azure,heappy,pprof"
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_save
|
|
|
|
|
|
|
|
# Lint protobufs.
|
|
|
|
protobuf-lint:
|
|
|
|
docker:
|
|
|
|
- image: bufbuild/buf:0.40.0
|
2021-10-21 15:06:45 +00:00
|
|
|
environment:
|
|
|
|
# Value to look for to skip breaking changes check
|
|
|
|
SKIP_LABEL: "https://api.github.com/repos/influxdata/influxdb_iox/labels/incompatible%20protobuf"
|
2021-03-29 16:55:50 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run:
|
|
|
|
name: buf lint
|
|
|
|
command: buf lint
|
2021-10-21 12:37:24 +00:00
|
|
|
- run:
|
|
|
|
name: buf breaking changes
|
|
|
|
command: |
|
|
|
|
echo "If you want to make changes forbidden by this lint, please"
|
2021-10-21 15:06:45 +00:00
|
|
|
echo "coordinate with the conductor team, add the 'incompatible protobuf' label"
|
|
|
|
echo "to the PR, and rerun this test"
|
|
|
|
# Check if label is present using github API:
|
|
|
|
# Inspired by https://discuss.circleci.com/t/tag-label-filter/11158
|
|
|
|
if wget -O - https://api.github.com/repos/influxdata/influxdb_iox/issues/$(echo $CIRCLE_PULL_REQUEST | grep -oE "[^/pull]+$") | grep "$SKIP_LABEL" ; then echo "SKIPPING (FOUND LABEL)" && exit ; else echo "CHECKING (NO LABEL FOUND)"; fi
|
2021-10-21 12:37:24 +00:00
|
|
|
git fetch origin main
|
|
|
|
# compare against only changes in this branch (not against
|
2021-11-05 18:06:30 +00:00
|
|
|
# other stuff that may have been added to main since last merge)
|
2021-10-21 12:37:24 +00:00
|
|
|
MERGE_BASE=$(git merge-base origin/main $CIRCLE_BRANCH) sh -c 'buf breaking --against ".git#ref=$MERGE_BASE"'
|
2021-03-29 16:55:50 +00:00
|
|
|
|
2020-11-26 13:38:27 +00:00
|
|
|
# Compile a cargo "release" profile binary for branches that end in `/perf`
|
|
|
|
#
|
|
|
|
# Uses the latest ci_image (influxdb/rust below) to build a release binary and
|
|
|
|
# copies it to a minimal container image based upon `rust:slim-buster`. This
|
2021-11-08 10:18:53 +00:00
|
|
|
# minimal image is then pushed to `quay.io/influxdb/iox:${BRANCH}` with '/'
|
2020-11-26 13:38:27 +00:00
|
|
|
# repaced by '.' - as an example:
|
|
|
|
#
|
2021-03-29 16:55:50 +00:00
|
|
|
# git branch: dom/my-awesome-feature/perf
|
2021-11-08 10:18:53 +00:00
|
|
|
# container: quay.io/influxdb/iox:dom.my-awesome-feature.perf
|
2020-11-26 13:38:27 +00:00
|
|
|
#
|
|
|
|
# Subsequent CI runs will overwrite the tag if you push more changes, so watch
|
|
|
|
# out for parallel CI runs!
|
|
|
|
#
|
|
|
|
# To change the contents of the build container, modify docker/Dockerfile.ci
|
2021-11-29 14:10:53 +00:00
|
|
|
# To change the final release container, modify docker/Dockerfile.iox
|
2020-06-29 19:33:41 +00:00
|
|
|
perf_image:
|
2021-12-06 14:11:28 +00:00
|
|
|
# need a machine executor to have a full-powered docker daemon (the `setup_remote_docker` system just provides a
|
|
|
|
# kinda small node)
|
|
|
|
machine:
|
|
|
|
image: ubuntu-2004:202111-01
|
2021-11-29 14:10:53 +00:00
|
|
|
resource_class: xlarge # use of a smaller executor tends crashes on link
|
2021-03-29 16:55:50 +00:00
|
|
|
environment:
|
2021-08-17 10:09:18 +00:00
|
|
|
# Disable incremental compilation to avoid overhead. We are not preserving these files anyway.
|
|
|
|
CARGO_INCREMENTAL: "0"
|
|
|
|
# We keep the debug symbols (Enabled in Cargo.toml as debug = true)
|
|
|
|
# workaround dynamic CPU detection bug in croaring
|
|
|
|
# https://github.com/influxdata/influxdb_iox/pull/2119
|
|
|
|
ROARING_ARCH: "haswell"
|
|
|
|
# Use avx512 instructions to take full advantage of the CPUs instruction set
|
|
|
|
RUSTFLAGS: "-C target-feature=+avx2"
|
2020-06-29 19:33:41 +00:00
|
|
|
steps:
|
|
|
|
- checkout
|
2021-12-06 14:11:28 +00:00
|
|
|
- run: |
|
|
|
|
echo "$QUAY_INFLUXDB_IOX_PASS" | docker login quay.io --username $QUAY_INFLUXDB_IOX_USER --password-stdin
|
2020-06-29 19:33:41 +00:00
|
|
|
- run:
|
2020-07-08 14:02:58 +00:00
|
|
|
name: Cargo release build with target arch set for CRoaring
|
2021-12-06 14:11:28 +00:00
|
|
|
command: |
|
|
|
|
COMMIT_SHA=$(git rev-parse --short HEAD)
|
|
|
|
|
2021-12-07 08:26:03 +00:00
|
|
|
RUST_VERSION=$(sed -E -ne 's/channel = "(.*)"/\1/p' rust-toolchain.toml)
|
|
|
|
|
2021-12-06 14:11:28 +00:00
|
|
|
docker buildx build \
|
2021-12-07 08:26:03 +00:00
|
|
|
--build-arg RUST_VERSION="$RUST_VERSION" \
|
2021-12-06 14:11:28 +00:00
|
|
|
--build-arg RUSTFLAGS="-C target-feature=+avx2" \
|
2021-12-06 16:42:21 +00:00
|
|
|
--progress plain \
|
2021-12-06 16:37:02 +00:00
|
|
|
--tag quay.io/influxdb/iox:"$COMMIT_SHA" \
|
|
|
|
--tag quay.io/influxdb/iox:"$(echo "$CIRCLE_BRANCH" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/_/g')" \
|
2021-12-06 14:11:28 +00:00
|
|
|
.
|
|
|
|
|
|
|
|
docker run -it --rm quay.io/influxdb/iox:$COMMIT_SHA debug print-cpu
|
|
|
|
|
|
|
|
docker push --all-tags quay.io/influxdb/iox
|
|
|
|
|
|
|
|
echo "export COMMIT_SHA=${COMMIT_SHA}" >> $BASH_ENV
|
2021-12-06 08:49:07 +00:00
|
|
|
# linking might take a while and doesn't produce CLI output
|
|
|
|
no_output_timeout: 20m
|
2021-01-14 15:32:16 +00:00
|
|
|
- run:
|
|
|
|
name: Deploy tags
|
2021-11-08 14:17:36 +00:00
|
|
|
command: |
|
|
|
|
echo "$QUAY_PASS" | docker login quay.io --username $QUAY_USER --password-stdin
|
|
|
|
./.circleci/get-deploy-tags.sh "${COMMIT_SHA}"
|
2021-03-29 16:55:50 +00:00
|
|
|
- cache_save
|
2020-02-07 15:39:31 +00:00
|
|
|
|
2020-11-26 13:38:27 +00:00
|
|
|
# Prepare the CI image used for other tasks.
|
|
|
|
#
|
|
|
|
# A nightly job (scheduled below in the `workflows` section) to build the CI
|
|
|
|
# image (influxdb/rust) used for the rest of the checks.
|
|
|
|
#
|
|
|
|
# To modify the contents of the CI image, update docker/Dockerfile.ci
|
|
|
|
ci_image:
|
2021-11-18 09:55:36 +00:00
|
|
|
# Use a `machine` executor instead of a docker-based because:
|
|
|
|
# - we bootstrap our CI images somehow (we could use a docker-hub image as well)
|
|
|
|
# - the machine executor also supports multi-arch builds
|
|
|
|
# - we only run this job once a day, so the additional startup delay of 30-60s doesn't really matter
|
2021-11-17 13:17:27 +00:00
|
|
|
machine:
|
2021-11-18 09:55:36 +00:00
|
|
|
# https://circleci.com/docs/2.0/configuration-reference/#available-machine-images
|
2021-11-17 13:17:27 +00:00
|
|
|
image: ubuntu-2004:202107-02
|
2020-11-26 13:38:27 +00:00
|
|
|
resource_class: xlarge
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
- run: |
|
|
|
|
echo "$QUAY_PASS" | docker login quay.io --username $QUAY_USER --password-stdin
|
|
|
|
- run: |
|
|
|
|
COMMIT_SHA=$(git rev-parse --short HEAD)
|
2021-06-17 14:48:06 +00:00
|
|
|
RUST_VERSION=$(sed -E -ne 's/channel = "(.*)"/\1/p' rust-toolchain.toml)
|
2021-11-17 13:17:27 +00:00
|
|
|
docker --version
|
|
|
|
docker build -t quay.io/influxdb/rust:$COMMIT_SHA -t quay.io/influxdb/rust:ci -f docker/Dockerfile.ci --build-arg RUST_VERSION=$RUST_VERSION .
|
|
|
|
docker push --all-tags quay.io/influxdb/rust
|
2021-11-05 18:06:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
parameters:
|
|
|
|
ci_image:
|
2021-12-06 16:37:02 +00:00
|
|
|
description: "Trigger build of CI image"
|
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
perf_image:
|
|
|
|
description: "Trigger build of perf image"
|
2021-11-05 18:06:30 +00:00
|
|
|
type: boolean
|
|
|
|
default: false
|
|
|
|
|
2020-02-07 15:39:31 +00:00
|
|
|
workflows:
|
|
|
|
version: 2
|
2021-03-29 16:55:50 +00:00
|
|
|
|
|
|
|
# CI for all pull requests.
|
|
|
|
ci:
|
2021-11-05 18:06:30 +00:00
|
|
|
when:
|
|
|
|
not: << pipeline.parameters.ci_image >>
|
2021-03-29 16:55:50 +00:00
|
|
|
jobs:
|
|
|
|
- fmt
|
|
|
|
- lint
|
2021-09-21 09:01:30 +00:00
|
|
|
- cargo_audit
|
2021-03-29 16:55:50 +00:00
|
|
|
- protobuf-lint
|
|
|
|
- test
|
2021-08-13 13:20:08 +00:00
|
|
|
- test_heappy
|
2021-09-09 14:24:24 +00:00
|
|
|
- test_perf
|
2021-03-29 16:55:50 +00:00
|
|
|
- build
|
2021-04-27 10:54:33 +00:00
|
|
|
- doc
|
2021-11-19 16:05:34 +00:00
|
|
|
- workspace_hack_checks
|
2020-06-29 19:33:41 +00:00
|
|
|
- perf_image:
|
2020-11-26 16:46:59 +00:00
|
|
|
filters:
|
|
|
|
branches:
|
2021-04-28 08:12:34 +00:00
|
|
|
only: main
|
2021-11-29 14:10:53 +00:00
|
|
|
requires: # Only do a release build if all tests have passed
|
2020-06-29 19:33:41 +00:00
|
|
|
- fmt
|
|
|
|
- lint
|
2021-09-21 09:01:30 +00:00
|
|
|
- cargo_audit
|
2021-11-05 18:06:30 +00:00
|
|
|
- protobuf-lint
|
2020-06-29 19:33:41 +00:00
|
|
|
- test
|
2021-11-05 18:06:30 +00:00
|
|
|
- test_heappy
|
|
|
|
- test_perf
|
2020-06-29 19:33:41 +00:00
|
|
|
- build
|
2021-11-05 18:06:30 +00:00
|
|
|
- doc
|
2021-03-29 16:55:50 +00:00
|
|
|
|
2021-11-05 18:06:30 +00:00
|
|
|
# Manual build of CI image
|
2020-05-28 01:25:57 +00:00
|
|
|
ci_image:
|
2021-11-05 18:06:30 +00:00
|
|
|
when: << pipeline.parameters.ci_image >>
|
|
|
|
jobs:
|
|
|
|
- ci_image
|
|
|
|
|
2021-12-06 16:37:02 +00:00
|
|
|
# Manual build of perf image
|
|
|
|
perf_image:
|
|
|
|
when: << pipeline.parameters.perf_image >>
|
|
|
|
jobs:
|
|
|
|
- perf_image
|
|
|
|
|
2021-11-05 18:06:30 +00:00
|
|
|
# Nightly rebuild of the build container
|
|
|
|
ci_image_nightly:
|
2020-05-28 01:25:57 +00:00
|
|
|
triggers:
|
|
|
|
- schedule:
|
|
|
|
cron: "0 5 * * *"
|
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only:
|
2020-11-11 11:40:38 +00:00
|
|
|
- main
|
2020-05-28 01:25:57 +00:00
|
|
|
jobs:
|
|
|
|
- ci_image
|