feat: gitops adapter ci build (#3692)

* chore: remove references to perf_image in CI

* chore: adding gitops adapter image build in CI

* chore: gitops adapter bin now same as dir & package so docker build works

* fix: circle config package change after renaming gitops adapter package
pull/24376/head
Luke Bond 2022-02-10 11:23:06 +00:00 committed by GitHub
parent ad60dc6949
commit 54890525da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 48 additions and 38 deletions

View File

@ -442,11 +442,21 @@ jobs:
--tag quay.io/influxdb/iox_data_generator:"$COMMIT_SHA" \
--tag quay.io/influxdb/iox_data_generator:"$BRANCH" \
.
docker buildx build \
--build-arg FEATURES="" \
--build-arg PACKAGE="iox_gitops_adapter" \
--build-arg RUST_VERSION="$RUST_VERSION" \
--build-arg RUSTFLAGS="-C target-feature=+avx2 -C link-arg=-fuse-ld=lld" \
--progress plain \
--tag quay.io/influxdb/iox_gitops_adapter:"$COMMIT_SHA" \
--tag quay.io/influxdb/iox_gitops_adapter:"$BRANCH" \
.
docker run -it --rm quay.io/influxdb/iox:$COMMIT_SHA debug print-cpu
docker push --all-tags quay.io/influxdb/iox
docker push --all-tags quay.io/influxdb/iox_data_generator
docker push --all-tags quay.io/influxdb/iox_gitops_adapter
echo "export COMMIT_SHA=${COMMIT_SHA}" >> $BASH_ENV
# linking might take a while and doesn't produce CLI output
@ -537,7 +547,7 @@ workflows:
jobs:
- ci_image
# Manual build of perf image.
# Manual build of release image for a branch.
# Trigger using the CircleCI API, like so:
#
# # e.g. using 'xh' (https://github.com/ducaale/xh)

60
Cargo.lock generated
View File

@ -1509,36 +1509,6 @@ version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4"
[[package]]
name = "gitops_adapter"
version = "0.1.0"
dependencies = [
"assert_matches",
"async-trait",
"chrono",
"clap 3.0.14",
"dotenv",
"futures",
"glob",
"k8s-openapi",
"kube",
"kube-derive",
"kube-runtime",
"parking_lot 0.11.2",
"pbjson-build",
"prost",
"schemars",
"serde",
"serde_json",
"thiserror",
"tokio",
"tonic",
"tonic-build",
"tracing",
"trogging",
"workspace-hack",
]
[[package]]
name = "glob"
version = "0.3.0"
@ -2176,6 +2146,36 @@ dependencies = [
"uuid",
]
[[package]]
name = "iox_gitops_adapter"
version = "0.1.0"
dependencies = [
"assert_matches",
"async-trait",
"chrono",
"clap 3.0.14",
"dotenv",
"futures",
"glob",
"k8s-openapi",
"kube",
"kube-derive",
"kube-runtime",
"parking_lot 0.11.2",
"pbjson-build",
"prost",
"schemars",
"serde",
"serde_json",
"thiserror",
"tokio",
"tonic",
"tonic-build",
"tracing",
"trogging",
"workspace-hack",
]
[[package]]
name = "iox_object_store"
version = "0.1.0"

View File

@ -9,7 +9,6 @@ members = [
"db",
"dml",
"generated_types",
"gitops_adapter",
"grpc-router",
"grpc-router-test-gen",
"influxdb_iox",
@ -23,6 +22,7 @@ members = [
"internal_types",
"iox_catalog",
"iox_data_generator",
"iox_gitops_adapter",
"iox_object_store",
"job_registry",
"lifecycle",

View File

@ -1,5 +1,5 @@
[package]
name = "gitops_adapter"
name = "iox_gitops_adapter"
version = "0.1.0"
authors = ["Luke Bond <luke.n.bond@gmail.com>"]
edition = "2021"
@ -8,7 +8,7 @@ edition = "2021"
publish = false
[[bin]]
name = "iox-gitops-adapter"
name = "iox_gitops_adapter"
path = "src/main.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -54,16 +54,16 @@ enum CatalogError {
// [Clap]: https://github.com/clap-rs/clap
#[derive(Debug, clap::Parser)]
#[clap(
name = "iox-gitops-adapter",
name = "iox_gitops_adapter",
about = "Adapter to configure IOx Catalog from Kubernetes Custom Resources",
long_about = r#"Kubernetes controller responsible for synchronising the IOx Catalog to cluster configuration in a Kubernetes Custom Resource.
Examples:
# Run the gitops adapter server:
iox-gitops-adapter
iox_gitops_adapter
# See all configuration options
iox-gitops-adapter --help
iox_gitops_adapter --help
"#,
version = concat!(env!("CARGO_PKG_VERSION"), " - ", env!("GIT_HASH"))
)]
@ -348,7 +348,7 @@ async fn main() {
let _drop_handle = setup_tracing(&config.logging_config, None).unwrap();
debug!(?config, "loaded config");
info!(git_hash = env!("GIT_HASH"), "starting iox-gitops-adapter");
info!(git_hash = env!("GIT_HASH"), "starting iox_gitops_adapter");
let k8s_client = K8sClient::try_default()
.await