diff --git a/.github/workflows/build-rhel7.yml b/.github/workflows/build-rhel7.yml index ab16610..a350caa 100644 --- a/.github/workflows/build-rhel7.yml +++ b/.github/workflows/build-rhel7.yml @@ -99,10 +99,17 @@ jobs: # id: daqingest_version_set # working-directory: ${{steps.wdset.outputs.gh}}/build/daqingest/target/release - run: "echo 'version: [${{steps.daqingest_version_set.outputs.daqingest_version}}]'" + - run: "mkdir daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}}" + - run: "cp ${{steps.wdset.outputs.gh}}/build/daqingest/target/release/daqingest daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}}/daqingest" + - run: "tar -czf daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}}.tar.gz daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}}" - uses: actions/upload-artifact@v3 with: name: daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}} path: ${{steps.wdset.outputs.gh}}/build/daqingest/target/release/daqingest + - uses: actions/upload-artifact@v3 + with: + name: daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}}.tar.gz + path: daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}}.tar.gz - run: echo "{\"tag_name\":\"buildaction\", \"name\":\"daqingest-${{steps.daqingest_version_set.outputs.daqingest_version}}\", \"draft\":true, \"prerelease\":true}" > create-rel.json - run: "curl -v -o rel.json -L -X POST -H content-type:application/json -H 'accept:application/vnd.github+json' -H 'authorization:bearer ${{secrets.github_token}}' -H 'x-github-api-version: 2022-11-28' -T create-rel.json https://api.github.com/repos/paulscherrerinstitute/daqingest/releases" - run: cat rel.json diff --git a/daqingest/Cargo.toml b/daqingest/Cargo.toml index ffcd9ec..8fbcf94 100644 --- a/daqingest/Cargo.toml +++ b/daqingest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "daqingest" -version = "0.2.0-alpha.0" +version = "0.2.0-alpha.1" authors = ["Dominik Werder "] edition = "2021" diff --git a/daqingest/src/daemon.rs b/daqingest/src/daemon.rs index 0c96c9e..c14fa8c 100644 --- a/daqingest/src/daemon.rs +++ b/daqingest/src/daemon.rs @@ -669,24 +669,14 @@ impl Daemon { async fn check_caconn_chans(&mut self) -> Result<(), Error> { if self.caconn_last_channel_check.elapsed() > CHANNEL_CHECK_INTERVAL { - debug!("Issue channel check to all CaConn"); - todo!(); - // self.ingest_commons - // .ca_conn_set - // .enqueue_command_to_all(|| ConnCommand::check_health()) - // .await?; + self.connset_ctrl.check_health().await?; self.caconn_last_channel_check = Instant::now(); } Ok(()) } async fn ca_conn_send_shutdown(&mut self) -> Result<(), Error> { - warn!("send shutdown to all ca connections"); - todo!(); - // self.ingest_commons - // .ca_conn_set - // .enqueue_command_to_all(|| ConnCommand::shutdown()) - // .await?; + self.connset_ctrl.shutdown().await?; Ok(()) } diff --git a/netfetch/src/ca/connset.rs b/netfetch/src/ca/connset.rs index 7ed2cf9..0c92a71 100644 --- a/netfetch/src/ca/connset.rs +++ b/netfetch/src/ca/connset.rs @@ -53,6 +53,7 @@ pub struct ChannelAdd { #[derive(Debug)] pub enum ConnSetCmd { ChannelAdd(ChannelAdd), + CheckHealth, Shutdown, } @@ -87,6 +88,18 @@ impl CaConnSetCtrl { self.tx.send(CaConnSetEvent::ConnSetCmd(cmd)).await?; Ok(()) } + + pub async fn shutdown(&self) -> Result<(), Error> { + let cmd = ConnSetCmd::Shutdown; + self.tx.send(CaConnSetEvent::ConnSetCmd(cmd)).await?; + Ok(()) + } + + pub async fn check_health(&self) -> Result<(), Error> { + let cmd = ConnSetCmd::CheckHealth; + self.tx.send(CaConnSetEvent::ConnSetCmd(cmd)).await?; + Ok(()) + } } pub struct CaConnSet { @@ -138,7 +151,12 @@ impl CaConnSet { match ev { CaConnSetEvent::ConnSetCmd(cmd) => match cmd { ConnSetCmd::ChannelAdd(x) => self.add_channel_to_addr(x).await, + ConnSetCmd::CheckHealth => { + error!("TODO implement check health"); + Ok(()) + } ConnSetCmd::Shutdown => { + debug!("shutdown received"); self.shutdown = true; Ok(()) }