-
Notifications
You must be signed in to change notification settings - Fork 2k
enhancement(vdev): Load compose files and inject network block #17025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e6de82
fc15fbd
537049b
06433ab
1209010
7b7a346
1562ad7
a9df591
e1bef44
317da52
76a9b97
0dd377a
54aacd0
1a64739
cc03e3c
ba1f01f
e69623b
6a7e226
612e1e0
eacf027
cd1e267
4b0260e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,7 +10,3 @@ services: | |
| command: | ||
| - -p | ||
| - /public.pem | ||
|
|
||
| networks: | ||
| default: | ||
| name: ${VECTOR_NETWORK} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,4 @@ services: | |
| - proxy | ||
|
|
||
| networks: | ||
| default: | ||
| name: ${VECTOR_NETWORK} | ||
| proxy: {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,3 @@ services: | |
| command: bin/pulsar standalone | ||
| ports: | ||
| - 6650:6650 | ||
|
|
||
| networks: | ||
| default: | ||
| name: ${VECTOR_NETWORK} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,3 @@ version: '3' | |
| services: | ||
| redis: | ||
| image: docker.io/redis:${CONFIG_VERSION} | ||
|
|
||
| networks: | ||
| default: | ||
| name: ${VECTOR_NETWORK} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,3 @@ services: | |
| - 8000:8000 | ||
| - 8088:8088 | ||
| - 8089:8089 | ||
|
|
||
| networks: | ||
| default: | ||
| name: ${VECTOR_NETWORK} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,3 @@ services: | |
| interval: 5s | ||
| timeout: 5s | ||
| retries: 3 | ||
|
|
||
| networks: | ||
| default: | ||
| name: ${VECTOR_NETWORK} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ use std::{env, fs}; | |
| use anyhow::{bail, Context, Result}; | ||
| use hashlink::LinkedHashMap; | ||
| use itertools::{self, Itertools}; | ||
| use serde::Deserialize; | ||
| use serde::{Deserialize, Serialize}; | ||
| use serde_yaml::Value; | ||
|
|
||
| use crate::{app, util}; | ||
|
|
@@ -37,20 +37,49 @@ impl RustToolchainConfig { | |
| } | ||
| } | ||
|
|
||
| #[derive(Debug, Deserialize)] | ||
| #[derive(Debug, Deserialize, Serialize)] | ||
| pub struct ComposeConfig { | ||
| pub services: BTreeMap<String, ComposeService>, | ||
| #[serde(default)] | ||
| #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] | ||
| pub volumes: BTreeMap<String, Value>, | ||
| #[serde(default)] | ||
| pub networks: BTreeMap<String, BTreeMap<String, String>>, | ||
| } | ||
|
|
||
| #[derive(Debug, Deserialize)] | ||
| #[derive(Debug, Deserialize, Serialize)] | ||
| pub struct ComposeService { | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub image: Option<String>, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was under the assumption that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might have been an artifact of me being copy pasta happy with that line above and putting it over even fields that are required or guaranteed to be included.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah but in this case it was added because
version: "3"
services:
dnstap:
build:
context: ../../../tests/data/dnstap
container_name: vector_dnstap
hostname: ns.example.com
volumes:
- dnstap-sockets:/bind1/etc/bind/socket
- dnstap-sockets:/bind2/etc/bind/socket
- dnstap-sockets:/bind3/etc/bind/socket
volumes:
dnstap-sockets: {}
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. noting that
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But it is required to capture and recreate the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, yeah I was just adding a case example to Spencer's earlier question, could have quoted that
|
||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub hostname: Option<String>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub container_name: Option<String>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub build: Option<Value>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub command: Option<Command>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub ports: Option<Vec<String>>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub env_file: Option<Vec<String>>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub volumes: Option<Vec<String>>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub environment: Option<Vec<String>>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub depends_on: Option<Vec<String>>, | ||
| #[serde(default, skip_serializing_if = "Option::is_none")] | ||
| pub healthcheck: Option<Value>, | ||
| } | ||
|
|
||
| #[derive(Debug, Deserialize, Serialize)] | ||
| #[serde(untagged)] | ||
| pub enum Command { | ||
| Single(String), | ||
| Multiple(Vec<String>), | ||
| } | ||
|
|
||
| impl ComposeConfig { | ||
| #[cfg(unix)] | ||
| pub fn parse(path: &Path) -> Result<Self> { | ||
| let contents = | ||
| fs::read_to_string(path).with_context(|| format!("failed to read {path:?}"))?; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why this needed updating? It looks like it didn't change the actual crate version, so it's just reflecting what we're already using.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could be wrong but when I tried a merge master it used tempfile 3.5.0. So I tried matching the version. I assume I need to have these in the
vdev/Cargo.tomlmatch the one in the repo level.