Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Update test debugging
Browse files Browse the repository at this point in the history
Signed-off-by: johnsonw <wjohnson@whamcloud.com>
  • Loading branch information
johnsonw committed Jul 14, 2020
1 parent f5f980a commit 2913f10
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 7 deletions.
19 changes: 19 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ services:
context: .
dockerfile: ./corosync.dockerfile
deploy: *default-deploy
environment:
- LOG_LEVEL=20
volumes:
- "manager-config:/var/lib/chroma"
gunicorn:
Expand All @@ -182,6 +184,7 @@ services:
environment:
- USE_CONSOLE=1
- PROXY_HOST=gunicorn
- LOG_LEVEL=20
volumes:
- "manager-config:/var/lib/chroma"
http-agent:
Expand All @@ -195,6 +198,7 @@ services:
deploy: *default-deploy
environment:
- PROXY_HOST=http-agent
- LOG_LEVEL=20
iml-agent-comms:
image: "imlteam/iml-agent-comms:6.2.0-dev"
volumes:
Expand Down Expand Up @@ -223,13 +227,16 @@ services:
- DEVICE_AGGREGATOR_URL=http://device:8008
- PROXY_HOST=iml-action-runner
- INFLUXDB_SERVER_FQDN=influxdb
- LOG_LEVEL=20
lustre-audit:
image: "imlteam/manager-lustre-audit:6.2.0-dev"
hostname: "lustre-audit"
build:
context: .
dockerfile: ./lustre-audit.dockerfile
deploy: *default-deploy
environment:
- LOG_LEVEL=20
volumes:
- "manager-config:/var/lib/chroma"
plugin-runner:
Expand All @@ -243,13 +250,16 @@ services:
- "manager-config:/var/lib/chroma"
environment:
- DEVICE_AGGREGATOR_URL=http://device:8008
- LOG_LEVEL=20
power-control:
image: "imlteam/manager-power-control:6.2.0-dev"
hostname: "power-control"
build:
context: .
dockerfile: ./power-control.dockerfile
deploy: *default-deploy
environment:
- LOG_LEVEL=20
volumes:
- "manager-config:/var/lib/chroma"
syslog:
Expand All @@ -259,6 +269,8 @@ services:
context: .
dockerfile: ./syslog.dockerfile
deploy: *default-deploy
environment:
- LOG_LEVEL=20
volumes:
- "manager-config:/var/lib/chroma"
iml-warp-drive:
Expand Down Expand Up @@ -314,6 +326,7 @@ services:
- "manager-config:/var/lib/chroma"
environment:
- SERVER_HTTP_URL=gunicorn
- RUST_LOG=info
iml-ostpool:
image: "imlteam/iml-ostpool:6.2.0-dev"
hostname: "iml-ostpool"
Expand All @@ -332,6 +345,8 @@ services:
context: ../
dockerfile: ./docker/iml-mailbox.dockerfile
deploy: *default-deploy
environment:
- RUST_LOG=info
volumes:
- "mailbox:/var/spool/iml/mailbox"
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
Expand Down Expand Up @@ -360,13 +375,16 @@ services:
- "manager-config:/var/lib/chroma"
environment:
- PROXY_HOST=iml-postoffice
- RUST_LOG=info
iml-timer:
image: "imlteam/iml-timer:6.2.0-dev"
hostname: "iml-timer"
build:
context: ../
dockerfile: ./docker/iml-timer.dockerfile
deploy: *default-deploy
environment:
- RUST_LOG=info
volumes:
- "/sys/fs/cgroup:/sys/fs/cgroup:ro"
- "timer_run:/run"
Expand All @@ -389,6 +407,7 @@ services:
- USE_STRATAGEM
- EXA_VERSION
- INFLUXDB_IML_STATS_LONG_DURATION
- LOG_LEVEL=20
deploy:
restart_policy:
condition: on-failure
Expand Down
21 changes: 15 additions & 6 deletions iml-system-test-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,14 +273,22 @@ impl Config {
pub fn get_setup_config(&self) -> String {
match &self.test_type {
TestType::Rpm => format!(
r#"USE_STRATAGEM = {}
BRANDING = "{}""#,
r#"USE_STRATAGEM={}
BRANDING={}
LOG_LEVEL=10
RUST_LOG=debug
NTP_SERVER_HOSTNAME=adm.local
"#,
if self.use_stratagem { "True" } else { "False" },
self.branding.to_string()
),
TestType::Docker => format!(
r#"USE_STRATAGEM={}
BRANDING={}"#,
BRANDING={}
LOG_LEVEL=10
RUST_LOG=debug
NTP_SERVER_HOSTNAME=10.73.10.1
"#,
self.use_stratagem,
self.branding.to_string()
),
Expand Down Expand Up @@ -447,7 +455,7 @@ pub async fn configure_iml(config: Config) -> Result<Config, CmdError> {
pub async fn deploy_servers(config: Config) -> Result<Config, CmdError> {
for (profile, hosts) in &config.profile_map {
let host_ips = config.hosts_to_ips(&hosts);
for host in host_ips {
for host in &host_ips {
tracing::debug!("pinging host to make sure it is up.");
ssh::ssh_exec_cmd(host, "uname -r")
.await?
Expand All @@ -463,6 +471,7 @@ pub async fn deploy_servers(config: Config) -> Result<Config, CmdError> {
};

ssh::add_servers(&config.manager_ip, profile, hosts).await?;
ssh::enable_debug_on_hosts(&host_ips).await?;
}

vagrant::halt()
Expand Down Expand Up @@ -616,12 +625,12 @@ pub async fn configure_rpm_setup(config: &Config) -> Result<(), CmdError> {

let vagrant_path = canonicalize("../vagrant/").await?;
let mut config_path = vagrant_path.clone();
config_path.push("local_settings.py");
config_path.push("overrides.conf");

let mut file = File::create(config_path).await?;
file.write_all(config_content.as_bytes()).await?;

let mut vm_cmd: String = "sudo cp /vagrant/local_settings.py /usr/share/chroma-manager/".into();
let mut vm_cmd: String = "mkdir -p /var/lib/chroma && sudo cp /vagrant/overrides.conf /var/lib/chroma".into();
if config.use_stratagem {
let mut server_profile_path = vagrant_path.clone();
server_profile_path.push("stratagem-server.profile");
Expand Down
6 changes: 6 additions & 0 deletions iml-system-test-utils/src/ssh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ pub async fn wait_for_ntp_for_adm<'a, 'b>(
ssh_script_parallel(hosts, "scripts/wait_for_ntp.sh", &["adm.local"]).await
}

pub async fn enable_debug_on_hosts<'a, 'b>(
hosts: &'b [&'a str],
) -> Result<Vec<(&'a str, Output)>, CmdError> {
ssh_script_parallel(hosts, "scripts/enable_debug.sh", &[]).await
}

pub async fn create_iml_diagnostics<'a, 'b>(
hosts: Vec<&'a str>,
prefix: &'a str,
Expand Down
12 changes: 12 additions & 0 deletions vagrant/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ Vagrant.configure('2') do |config|
mkdir -p /mnt/mdt{0,1}
SHELL

mds.vm.provision 'enable-debug',
type: 'shell',
run: 'never',
path: 'scripts/enable_debug.sh'
end
end

Expand Down Expand Up @@ -793,6 +797,10 @@ Vagrant.configure('2') do |config|
mkdir -p /mnt/ost{0..9}
SHELL

oss.vm.provision 'enable-debug',
type: 'shell',
run: 'never',
path: 'scripts/enable_debug.sh'
end
end

Expand Down Expand Up @@ -833,6 +841,10 @@ Vagrant.configure('2') do |config|
type: 'shell',
run: 'never',
path: './scripts/configure_lustre_network.sh'
c.vm.provision 'enable-debug',
type: 'shell',
run: 'never',
path: 'scripts/enable_debug.sh'

end
end
Expand Down
2 changes: 2 additions & 0 deletions vagrant/scripts/enable_debug.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
touch /tmp/chroma-agent-debug
2 changes: 1 addition & 1 deletion vagrant/scripts/wait_for_ntp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ systemctl stop ntpd.service
sntp -s "$NTP_SERVER"
sntp -s "$NTP_SERVER"

systemctl restart ntpd.service
systemctl start ntpd.service

until ntpstat;
do
Expand Down

0 comments on commit 2913f10

Please sign in to comment.