Skip to content

Commit aba0400

Browse files
authored
Merge pull request #697 from kate-goldenring/hippo-to-0.19
2 parents 639cb10 + 0f3f79f commit aba0400

File tree

5 files changed

+47
-43
lines changed

5 files changed

+47
-43
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
nomadUrl: "https://releases.hashicorp.com/nomad/1.3.1/nomad_1.3.1_linux_amd64.zip",
3232
nomadBinary: "nomad",
3333
pathInNomadArchive: "nomad",
34-
hippoUrl: "https://github.com/deislabs/hippo/releases/download/v0.17.0/hippo-server-linux-x64.tar.gz",
34+
hippoUrl: "https://github.com/deislabs/hippo/releases/download/v0.19.0/hippo-server-linux-x64.tar.gz",
3535
wasmtimeUrl: "https://github.com/bytecodealliance/wasmtime/releases/download/v0.36.0/wasmtime-v0.36.0-x86_64-linux.tar.xz",
3636
wasmtimeBinary: "wasmtime",
3737
pathInWasmtimeArchive: "wasmtime-v0.36.0-x86_64-linux/wasmtime",
@@ -47,7 +47,7 @@ jobs:
4747
nomadUrl: "https://releases.hashicorp.com/nomad/1.3.1/nomad_1.3.1_darwin_amd64.zip",
4848
nomadBinary: "nomad",
4949
pathInNomadArchive: "nomad",
50-
hippoUrl: "https://github.com/deislabs/hippo/releases/download/v0.17.0/hippo-server-osx-x64.tar.gz",
50+
hippoUrl: "https://github.com/deislabs/hippo/releases/download/v0.19.0/hippo-server-osx-x64.tar.gz",
5151
}
5252
- {
5353
os: "windows-latest",
@@ -59,7 +59,7 @@ jobs:
5959
nomadUrl: "https://releases.hashicorp.com/nomad/1.3.1/nomad_1.3.1_windows_amd64.zip",
6060
nomadBinary: "nomad.exe",
6161
pathInNomadArchive: "nomad.exe",
62-
hippoUrl: "https://github.com/deislabs/hippo/releases/download/v0.17.0/hippo-server-win-x64.zip",
62+
hippoUrl: "https://github.com/deislabs/hippo/releases/download/v0.19.0/hippo-server-win-x64.zip",
6363
}
6464
steps:
6565
- uses: actions/checkout@v2
@@ -87,7 +87,7 @@ jobs:
8787
name: ${{ matrix.config.nomadBinary }}
8888
url: ${{ matrix.config.nomadUrl }}
8989
pathInArchive: ${{ matrix.config.pathInNomadArchive }}
90-
90+
9191
- name: Install hippo
9292
if: ${{ fromJSON(matrix.config.os != 'windows-latest') }}
9393
run: |
@@ -105,7 +105,7 @@ jobs:
105105
Expand-Archive .\hippo-server.zip .\hippo-server-output;
106106
echo "$((Get-Item .\hippo-server-output).FullName)\win-x64";
107107
echo "$((Get-Item .\hippo-server-output).FullName)\win-x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append;
108-
108+
109109
- uses: Swatinem/rust-cache@v1
110110

111111
- name: Cargo Format

Cargo.lock

Lines changed: 16 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ dirs = "4.0"
1717
dunce = "1.0"
1818
env_logger = "0.9"
1919
futures = "0.3"
20-
hippo-openapi = "0.8"
21-
hippo = { git = "https://github.com/deislabs/hippo-cli", rev = "67f6368fa39d296c3d1b11a93e43bc4c751cba6b"}
20+
hippo-openapi = "0.10"
21+
hippo = { git = "https://github.com/deislabs/hippo-cli", tag = "v0.15.0" }
2222
lazy_static = "1.4.0"
2323
nix = { version = "0.24", features = ["signal"] }
2424
outbound-redis = { path = "crates/outbound-redis" }
@@ -46,6 +46,7 @@ tracing = { version = "0.1", features = [ "log" ] }
4646
tracing-futures = "0.2"
4747
tracing-subscriber = { version = "0.3.7", features = [ "env-filter" ] }
4848
url = "2.2.2"
49+
uuid = "^1.0"
4950
wasi-outbound-http = { path = "crates/outbound-http" }
5051
wasmtime = "0.35.3"
5152

src/commands/deploy.rs

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::fs::File;
1414
use std::io::copy;
1515
use std::path::PathBuf;
1616
use url::Url;
17+
use uuid::Uuid;
1718

1819
use crate::{opts::*, parse_buildinfo, sloth::warn_if_slow_response};
1920

@@ -183,7 +184,7 @@ impl DeployCommand {
183184
let existing_channel_id = self
184185
.get_channel_id(&hippo_client, SPIN_DEPLOY_CHANNEL_NAME.to_string())
185186
.await?;
186-
Client::remove_channel(&hippo_client, existing_channel_id).await?;
187+
Client::remove_channel(&hippo_client, existing_channel_id.to_string()).await?;
187188
active_revision_id = Some(
188189
self.get_revision_id(&hippo_client, bindle_id.version_string().clone())
189190
.await?,
@@ -213,7 +214,12 @@ impl DeployCommand {
213214
.await
214215
.context("Problem creating a channel in Hippo")?;
215216

216-
let channel = Client::get_channel_by_id(&hippo_client, &channel_id)
217+
println!(
218+
"Deployed {} version {}",
219+
name.clone(),
220+
bindle_id.version_string()
221+
);
222+
let channel = Client::get_channel_by_id(&hippo_client, &channel_id.to_string())
217223
.await
218224
.context("Problem getting channel by id")?;
219225
if let Ok(http_config) = HttpTriggerConfiguration::try_from(cfg.info.trigger.clone()) {
@@ -273,39 +279,31 @@ impl DeployCommand {
273279
Ok(buildinfo)
274280
}
275281

276-
async fn get_app_id(&self, hippo_client: &Client, name: String) -> Result<String> {
282+
async fn get_app_id(&self, hippo_client: &Client, name: String) -> Result<Uuid> {
277283
let apps_vm = Client::list_apps(hippo_client).await?;
278-
let app = apps_vm.apps.iter().find(|&x| x.name == name.clone());
284+
let app = apps_vm.items.iter().find(|&x| x.name == name.clone());
279285
match app {
280-
Some(a) => Ok(a.id.clone()),
286+
Some(a) => Ok(a.id),
281287
None => anyhow::bail!("No app with name: {}", name),
282288
}
283289
}
284290

285-
async fn get_revision_id(
286-
&self,
287-
hippo_client: &Client,
288-
bindle_version: String,
289-
) -> Result<String> {
291+
async fn get_revision_id(&self, hippo_client: &Client, bindle_version: String) -> Result<Uuid> {
290292
let revisions = Client::list_revisions(hippo_client).await?;
291293
let revision = revisions
292-
.revisions
294+
.items
293295
.iter()
294296
.find(|&x| x.revision_number == bindle_version);
295297
Ok(revision
296298
.ok_or_else(|| anyhow::anyhow!("No revision with version {}", bindle_version))?
297-
.id
298-
.clone())
299+
.id)
299300
}
300301

301-
async fn get_channel_id(&self, hippo_client: &Client, name: String) -> Result<String> {
302+
async fn get_channel_id(&self, hippo_client: &Client, name: String) -> Result<Uuid> {
302303
let channels_vm = Client::list_channels(hippo_client).await?;
303-
let channel = channels_vm
304-
.channels
305-
.iter()
306-
.find(|&x| x.name == name.clone());
304+
let channel = channels_vm.items.iter().find(|&x| x.name == name.clone());
307305
match channel {
308-
Some(c) => Ok(c.id.clone()),
306+
Some(c) => Ok(c.id),
309307
None => anyhow::bail!("No channel with name: {}", name),
310308
}
311309
}
@@ -369,14 +367,10 @@ impl DeployCommand {
369367
async fn check_hippo_healthz(&self) -> Result<()> {
370368
let hippo_base_url = url::Url::parse(&self.hippo_server_url)?;
371369
let hippo_healthz_url = hippo_base_url.join("/healthz")?;
372-
let result = reqwest::get(hippo_healthz_url.to_string())
370+
reqwest::get(hippo_healthz_url.to_string())
373371
.await?
374-
.error_for_status()?
375-
.text()
376-
.await?;
377-
if result != "Healthy" {
378-
return Err(anyhow!("Hippo server {} is unhealthy", hippo_base_url));
379-
}
372+
.error_for_status()
373+
.with_context(|| format!("Hippo server {} is unhealthy", hippo_base_url))?;
380374
Ok(())
381375
}
382376
}

tests/integration.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ mod integration_tests {
316316
)?;
317317

318318
let apps_vm = hippo.client.list_apps().await?;
319-
assert_eq!(apps_vm.apps.len(), 1, "hippo apps: {apps_vm:?}");
319+
assert_eq!(apps_vm.items.len(), 1, "hippo apps: {apps_vm:?}");
320320

321321
Ok(())
322322
}
@@ -544,10 +544,8 @@ mod integration_tests {
544544
}
545545

546546
if let Ok(rsp) = reqwest::get(format!("{url}/healthz")).await {
547-
if let Ok(result) = rsp.text().await {
548-
if result == "Healthy" {
549-
break;
550-
}
547+
if rsp.status().is_success() {
548+
break;
551549
}
552550
}
553551

0 commit comments

Comments
 (0)