mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-08-17 20:53:29 +02:00
Compare commits
15 Commits
dagger-sdk
...
dagger-cor
Author | SHA1 | Date | |
---|---|---|---|
1725c5188e
|
|||
a13a2a9ecb
|
|||
b86710d71e
|
|||
08a2e30967
|
|||
b552dc5d75
|
|||
f869e574dd
|
|||
921e61b5e2
|
|||
17ec62a5d5
|
|||
803cfc4f8c
|
|||
8385aa8a15
|
|||
60f2cb2f2e
|
|||
30b7511e45
|
|||
06e2638e1f
|
|||
48433cf368
|
|||
fc01755b99
|
26
Cargo.lock
generated
26
Cargo.lock
generated
@@ -114,7 +114,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"color-eyre",
|
||||
"dagger-sdk 0.2.9",
|
||||
"dagger-sdk 0.2.11",
|
||||
"eyre",
|
||||
"tokio",
|
||||
]
|
||||
@@ -246,10 +246,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dagger-codegen"
|
||||
version = "0.2.5"
|
||||
version = "0.2.7"
|
||||
dependencies = [
|
||||
"convert_case",
|
||||
"dagger-core 0.2.3",
|
||||
"dagger-core 0.2.5",
|
||||
"eyre",
|
||||
"genco",
|
||||
"itertools",
|
||||
@@ -260,7 +260,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dagger-core"
|
||||
version = "0.2.3"
|
||||
version = "0.2.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71f74120a67a030e76c6039457909ba31e53fb022b0b633f5836f008eb4e1766"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"dirs",
|
||||
@@ -283,9 +285,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dagger-core"
|
||||
version = "0.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e18641c2b159006cab7d750c05d3272f0cabfe9532df20b47076353aa73bf1e"
|
||||
version = "0.2.5"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"dirs",
|
||||
@@ -313,7 +313,7 @@ dependencies = [
|
||||
"clap",
|
||||
"color-eyre",
|
||||
"dagger-codegen",
|
||||
"dagger-core 0.2.3",
|
||||
"dagger-core 0.2.5",
|
||||
"dirs",
|
||||
"eyre",
|
||||
"flate2",
|
||||
@@ -334,12 +334,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dagger-sdk"
|
||||
version = "0.2.9"
|
||||
version = "0.2.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8480af5a914d5ada1ff7fb8665b99b393e076acf8138af982170b2071cb3a9e3"
|
||||
checksum = "d86c5bf1ad09a730d6fc5c73c39664eb38b9843fc21dedfee4629976ae04cba4"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"dagger-core 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"dagger-core 0.2.4",
|
||||
"derive_builder",
|
||||
"eyre",
|
||||
"futures",
|
||||
@@ -351,10 +351,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dagger-sdk"
|
||||
version = "0.2.10"
|
||||
version = "0.2.12"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"dagger-core 0.2.3",
|
||||
"dagger-core 0.2.5",
|
||||
"derive_builder",
|
||||
"eyre",
|
||||
"futures",
|
||||
|
@@ -28,14 +28,11 @@ eyre = "0.6.8"
|
||||
flate2 = { version = "1.0.25", features = ["zlib"] }
|
||||
genco = "0.17.3"
|
||||
graphql-introspection-query = "0.2.0"
|
||||
graphql_client = { version = "0.12.0", features = [
|
||||
"reqwest",
|
||||
"reqwest-blocking",
|
||||
] }
|
||||
graphql_client = { version = "0.12.0", features = ["reqwest"] }
|
||||
hex = "0.4.3"
|
||||
hex-literal = "0.3.4"
|
||||
platform-info = "1.0.2"
|
||||
reqwest = { version = "0.11.14", features = ["stream", "blocking", "deflate"] }
|
||||
reqwest = { version = "0.11.14", features = ["stream", "deflate"] }
|
||||
serde = { version = "1.0.152", features = ["derive"] }
|
||||
serde_json = "1.0.93"
|
||||
sha2 = "0.10.6"
|
||||
|
73
ci/CHANGELOG.md
Normal file
73
ci/CHANGELOG.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## v0.1.0 (2023-02-20)
|
||||
|
||||
<csr-id-06e2638e1fec0579d992792b94838629739bb1f0/>
|
||||
<csr-id-48433cf36884ec9fa4cfed8bc5d4b3e8422c0ab9/>
|
||||
<csr-id-45d646203704aed317ee2273b825ae708e83ca32/>
|
||||
<csr-id-c35c104b49dc2f4456ed18e353bf8d4017cff640/>
|
||||
|
||||
### Chore
|
||||
|
||||
- <csr-id-06e2638e1fec0579d992792b94838629739bb1f0/> with actual await on connect
|
||||
- <csr-id-48433cf36884ec9fa4cfed8bc5d4b3e8422c0ab9/> with dagger v0.2.10
|
||||
- <csr-id-45d646203704aed317ee2273b825ae708e83ca32/> with async/await
|
||||
- <csr-id-c35c104b49dc2f4456ed18e353bf8d4017cff640/> update ci to use dagger-sdk v0.2.6
|
||||
|
||||
### Documentation
|
||||
|
||||
- <csr-id-30b7511e454d4695cc1106a3d303b20aa8647fe4/> add changelog
|
||||
|
||||
### New Features
|
||||
|
||||
- <csr-id-691ecfbf52fa24a466d554b7b9701d67c33a42a5/> ci with dagger v0.2.2
|
||||
- <csr-id-f42da8416a5450c7c3c924353c3cc9112afd18f0/> with sccache
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- <csr-id-f40ba9b40312a66b7699209fdddc0153ef139931/> with older version of dagger-sdk
|
||||
- <csr-id-02006d40fc2c0383e0412c15c36db9af7eda991f/> without phantom data
|
||||
- <csr-id-199fe16dbf426f287a7a5237c25bc16a4cae49bc/> update rust crate dagger-sdk to 0.2.1
|
||||
- <csr-id-25fb9d4f24af8e7d6d81463c19a07a718b8a312a/> with secret
|
||||
- <csr-id-d72313051b9b46a6eeaa909a11850b3d8fc75e81/> with test changes
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 16 commits contributed to the release over the course of 2 calendar days.
|
||||
- 12 commits were understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 2 unique issues were worked on: [#7](https://github.com/kjuulh/dagger-rs/issues/7), [#8](https://github.com/kjuulh/dagger-rs/issues/8)
|
||||
|
||||
### Commit Details
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **[#7](https://github.com/kjuulh/dagger-rs/issues/7)**
|
||||
- add ci ([`4ce58a4`](https://github.com/kjuulh/dagger-rs/commit/4ce58a418c0ccef6cc0bfbaa878453f03c02dffb))
|
||||
* **[#8](https://github.com/kjuulh/dagger-rs/issues/8)**
|
||||
- feature with workspace ([`03e022f`](https://github.com/kjuulh/dagger-rs/commit/03e022fcaccd30ef0566dcfe31beb3473706bd1d))
|
||||
* **Uncategorized**
|
||||
- add changelog ([`30b7511`](https://github.com/kjuulh/dagger-rs/commit/30b7511e454d4695cc1106a3d303b20aa8647fe4))
|
||||
- with actual await on connect ([`06e2638`](https://github.com/kjuulh/dagger-rs/commit/06e2638e1fec0579d992792b94838629739bb1f0))
|
||||
- with dagger v0.2.10 ([`48433cf`](https://github.com/kjuulh/dagger-rs/commit/48433cf36884ec9fa4cfed8bc5d4b3e8422c0ab9))
|
||||
- with older version of dagger-sdk ([`f40ba9b`](https://github.com/kjuulh/dagger-rs/commit/f40ba9b40312a66b7699209fdddc0153ef139931))
|
||||
- with async/await ([`45d6462`](https://github.com/kjuulh/dagger-rs/commit/45d646203704aed317ee2273b825ae708e83ca32))
|
||||
- update ci to use dagger-sdk v0.2.6 ([`c35c104`](https://github.com/kjuulh/dagger-rs/commit/c35c104b49dc2f4456ed18e353bf8d4017cff640))
|
||||
- without phantom data ([`02006d4`](https://github.com/kjuulh/dagger-rs/commit/02006d40fc2c0383e0412c15c36db9af7eda991f))
|
||||
- ci with dagger v0.2.2 ([`691ecfb`](https://github.com/kjuulh/dagger-rs/commit/691ecfbf52fa24a466d554b7b9701d67c33a42a5))
|
||||
- with bin cache ([`3cb83bb`](https://github.com/kjuulh/dagger-rs/commit/3cb83bb79ceda52a0bf459850252e3902b7352fa))
|
||||
- update rust crate dagger-sdk to 0.2.1 ([`199fe16`](https://github.com/kjuulh/dagger-rs/commit/199fe16dbf426f287a7a5237c25bc16a4cae49bc))
|
||||
- with secret ([`25fb9d4`](https://github.com/kjuulh/dagger-rs/commit/25fb9d4f24af8e7d6d81463c19a07a718b8a312a))
|
||||
- with sccache ([`f42da84`](https://github.com/kjuulh/dagger-rs/commit/f42da8416a5450c7c3c924353c3cc9112afd18f0))
|
||||
- with test changes ([`d723130`](https://github.com/kjuulh/dagger-rs/commit/d72313051b9b46a6eeaa909a11850b3d8fc75e81))
|
||||
- add ci ([`468bca4`](https://github.com/kjuulh/dagger-rs/commit/468bca4a69ec321b3ae1304d29d1be66a921a7db))
|
||||
</details>
|
||||
|
@@ -8,6 +8,6 @@ edition = "2021"
|
||||
[dependencies]
|
||||
clap = "4.1.6"
|
||||
color-eyre = "0.6.2"
|
||||
dagger-sdk = "0.2.6"
|
||||
dagger-sdk = "0.2.11"
|
||||
eyre = "0.6.8"
|
||||
tokio = { version = "1.25.0", features = ["full"] }
|
||||
|
@@ -12,7 +12,7 @@ async fn main() -> eyre::Result<()> {
|
||||
.subcommand(clap::Command::new("release"))
|
||||
.get_matches();
|
||||
|
||||
let client = dagger_sdk::connect()?;
|
||||
let client = dagger_sdk::connect().await?;
|
||||
|
||||
match matches.subcommand() {
|
||||
Some(("pr", _)) => {
|
||||
|
@@ -5,6 +5,58 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## v0.2.7 (2023-02-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 1 commit contributed to the release.
|
||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
### Commit Details
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- race condition in process ([`a13a2a9`](https://github.com/kjuulh/dagger-rs/commit/a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de))
|
||||
</details>
|
||||
|
||||
## v0.2.6 (2023-02-20)
|
||||
|
||||
<csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/>
|
||||
|
||||
### Chore
|
||||
|
||||
- <csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/> ran clippy
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 3 commits contributed to the release.
|
||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
### Commit Details
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`f869e57`](https://github.com/kjuulh/dagger-rs/commit/f869e574dd788cd60e5b1b5d502bec68e300694c))
|
||||
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`17ec62a`](https://github.com/kjuulh/dagger-rs/commit/17ec62a5d58232ff57391523b9851fb7b07d02ab))
|
||||
- ran clippy ([`803cfc4`](https://github.com/kjuulh/dagger-rs/commit/803cfc4f8c4d72ab7d011be5523b3bfc6039de39))
|
||||
</details>
|
||||
|
||||
## v0.2.5 (2023-02-19)
|
||||
|
||||
### New Features
|
||||
@@ -15,21 +67,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
```rust
|
||||
fn main() -> eyre::Result<()> {
|
||||
// ...
|
||||
// ...
|
||||
|
||||
client.container().from("rust").publish("somewhere")?;
|
||||
client.container().from("rust").publish("somewhere")?;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
}
|
||||
|
||||
// to
|
||||
|
||||
async fn main() -> eyre::Result<()> {
|
||||
// ...
|
||||
// ...
|
||||
|
||||
client.container().from("rust").publish("somewhere").await?;
|
||||
client.container().from("rust").publish("somewhere").await?;
|
||||
|
||||
// ...
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
@@ -37,7 +89,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 2 commits contributed to the release.
|
||||
- 3 commits contributed to the release.
|
||||
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
@@ -48,6 +100,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- Release dagger-sdk v0.2.8, dagger-codegen v0.2.5 ([`0499024`](https://github.com/kjuulh/dagger-rs/commit/04990247ba8e9d0555847f582fef14849dbedebf))
|
||||
- add documentation strings ([`978ede6`](https://github.com/kjuulh/dagger-rs/commit/978ede68ae52f5b5150a2aa45b8d6e1fbbbee2f4))
|
||||
- Use async runtime instead of blocking. ([`9be6f43`](https://github.com/kjuulh/dagger-rs/commit/9be6f435d9ea39f31a8906e55dbd3e8b1e5ec598))
|
||||
</details>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "dagger-codegen"
|
||||
version = "0.2.5"
|
||||
version = "0.2.7"
|
||||
edition = "2021"
|
||||
readme = "README.md"
|
||||
license-file = "LICENSE.MIT"
|
||||
@@ -11,7 +11,7 @@ publish = true
|
||||
|
||||
[dependencies]
|
||||
convert_case = "0.6.0"
|
||||
dagger-core = { path = "../dagger-core", version = "^0.2.2" }
|
||||
dagger-core = { path = "../dagger-core", version = "^0.2.5" }
|
||||
|
||||
eyre = "0.6.8"
|
||||
genco = "0.17.3"
|
||||
|
@@ -3,7 +3,7 @@ use genco::prelude::rust;
|
||||
use genco::quote;
|
||||
use itertools::Itertools;
|
||||
|
||||
use crate::functions::{type_ref_is_optional, CommonFunctions};
|
||||
use crate::functions::CommonFunctions;
|
||||
use crate::rust::functions::{
|
||||
field_options_struct_name, format_function, format_name, format_optional_args,
|
||||
format_struct_comment, format_struct_name,
|
||||
@@ -12,7 +12,7 @@ use crate::utility::OptionExt;
|
||||
|
||||
pub fn render_object(funcs: &CommonFunctions, t: &FullType) -> eyre::Result<rust::Tokens> {
|
||||
let selection = rust::import("crate::querybuilder", "Selection");
|
||||
let child = rust::import("std::process", "Child");
|
||||
let child = rust::import("tokio::process", "Child");
|
||||
let conn = rust::import("dagger_core::connect_params", "ConnectParams");
|
||||
let arc = rust::import("std::sync", "Arc");
|
||||
|
||||
|
@@ -5,12 +5,11 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## v0.2.3 (2023-02-20)
|
||||
## v0.2.5 (2023-02-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- <csr-id-75bc17e57db222492c6ffd2dfe80208d2bda75c9/> Fix async panic on blocking #19
|
||||
Replaced internal threads with tokio spawn functions
|
||||
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
@@ -27,6 +26,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- race condition in process ([`a13a2a9`](https://github.com/kjuulh/dagger-rs/commit/a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de))
|
||||
</details>
|
||||
|
||||
## v0.2.4 (2023-02-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- <csr-id-8385aa8a15ff7b45fecc3462c482b998118c14eb/> remove blocking
|
||||
- <csr-id-921e61b5e248013cb5fbf4f1bad3eef5a2673145/> remove blocking
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 4 commits contributed to the release.
|
||||
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
### Commit Details
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`f869e57`](https://github.com/kjuulh/dagger-rs/commit/f869e574dd788cd60e5b1b5d502bec68e300694c))
|
||||
- remove blocking ([`921e61b`](https://github.com/kjuulh/dagger-rs/commit/921e61b5e248013cb5fbf4f1bad3eef5a2673145))
|
||||
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`17ec62a`](https://github.com/kjuulh/dagger-rs/commit/17ec62a5d58232ff57391523b9851fb7b07d02ab))
|
||||
- remove blocking ([`8385aa8`](https://github.com/kjuulh/dagger-rs/commit/8385aa8a15ff7b45fecc3462c482b998118c14eb))
|
||||
</details>
|
||||
|
||||
## v0.2.3 (2023-02-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- <csr-id-75bc17e57db222492c6ffd2dfe80208d2bda75c9/> Fix async panic on blocking #19
|
||||
Replaced internal threads with tokio spawn functions
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 2 commits contributed to the release.
|
||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
### Commit Details
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- Release dagger-core v0.2.3, dagger-sdk v0.2.9, dagger-rs v0.2.10 ([`82de43a`](https://github.com/kjuulh/dagger-rs/commit/82de43aa91d6a5e09a247d1959137fdc36a40d35))
|
||||
- Fix async panic on blocking #19 ([`75bc17e`](https://github.com/kjuulh/dagger-rs/commit/75bc17e57db222492c6ffd2dfe80208d2bda75c9))
|
||||
</details>
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "dagger-core"
|
||||
version = "0.2.3"
|
||||
version = "0.2.5"
|
||||
edition = "2021"
|
||||
readme = "README.md"
|
||||
license-file = "LICENSE.MIT"
|
||||
@@ -16,14 +16,11 @@ eyre = "0.6.8"
|
||||
flate2 = { version = "1.0.25", features = ["zlib"] }
|
||||
genco = "0.17.3"
|
||||
graphql-introspection-query = "0.2.0"
|
||||
graphql_client = { version = "0.12.0", features = [
|
||||
"reqwest",
|
||||
"reqwest-blocking",
|
||||
] }
|
||||
graphql_client = { version = "0.12.0", features = ["reqwest"] }
|
||||
hex = "0.4.3"
|
||||
hex-literal = "0.3.4"
|
||||
platform-info = "1.0.2"
|
||||
reqwest = { version = "0.11.14", features = ["stream", "blocking", "deflate"] }
|
||||
reqwest = { version = "0.11.14", features = ["stream", "deflate"] }
|
||||
serde = { version = "1.0.152", features = ["derive"] }
|
||||
serde_json = "1.0.93"
|
||||
sha2 = "0.10.6"
|
||||
|
@@ -6,6 +6,8 @@ use std::{
|
||||
sync::Arc,
|
||||
};
|
||||
|
||||
use tokio::io::AsyncBufReadExt;
|
||||
|
||||
use crate::{config::Config, connect_params::ConnectParams};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -24,7 +26,7 @@ impl CliSession {
|
||||
&self,
|
||||
config: &Config,
|
||||
cli_path: &PathBuf,
|
||||
) -> eyre::Result<(ConnectParams, Child)> {
|
||||
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
self.inner.connect(config, cli_path).await
|
||||
}
|
||||
}
|
||||
@@ -37,13 +39,13 @@ impl InnerCliSession {
|
||||
&self,
|
||||
config: &Config,
|
||||
cli_path: &PathBuf,
|
||||
) -> eyre::Result<(ConnectParams, Child)> {
|
||||
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
let proc = self.start(config, cli_path)?;
|
||||
let params = self.get_conn(proc).await?;
|
||||
Ok(params)
|
||||
}
|
||||
|
||||
fn start(&self, config: &Config, cli_path: &PathBuf) -> eyre::Result<std::process::Child> {
|
||||
fn start(&self, config: &Config, cli_path: &PathBuf) -> eyre::Result<tokio::process::Child> {
|
||||
let mut args: Vec<String> = vec!["session".into()];
|
||||
if let Some(workspace) = &config.workdir_path {
|
||||
let abs_path = canonicalize(workspace)?;
|
||||
@@ -54,7 +56,7 @@ impl InnerCliSession {
|
||||
args.extend(["--project".into(), abs_path.to_string_lossy().to_string()])
|
||||
}
|
||||
|
||||
let proc = std::process::Command::new(
|
||||
let proc = tokio::process::Command::new(
|
||||
cli_path
|
||||
.to_str()
|
||||
.ok_or(eyre::anyhow!("could not get string from path"))?,
|
||||
@@ -72,8 +74,8 @@ impl InnerCliSession {
|
||||
|
||||
async fn get_conn(
|
||||
&self,
|
||||
mut proc: std::process::Child,
|
||||
) -> eyre::Result<(ConnectParams, std::process::Child)> {
|
||||
mut proc: tokio::process::Child,
|
||||
) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
let stdout = proc
|
||||
.stdout
|
||||
.take()
|
||||
@@ -87,22 +89,22 @@ impl InnerCliSession {
|
||||
let (sender, mut receiver) = tokio::sync::mpsc::channel(1);
|
||||
|
||||
tokio::spawn(async move {
|
||||
let stdout_bufr = BufReader::new(stdout);
|
||||
for line in stdout_bufr.lines() {
|
||||
let stdout_bufr = tokio::io::BufReader::new(stdout);
|
||||
for line in stdout_bufr.lines().next_line().await {
|
||||
let out = line.as_ref().unwrap();
|
||||
if let Ok(conn) = serde_json::from_str::<ConnectParams>(&out) {
|
||||
sender.send(conn).await.unwrap();
|
||||
}
|
||||
if let Ok(line) = line {
|
||||
if let Some(line) = line {
|
||||
println!("dagger: {}", line);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
tokio::spawn(async move {
|
||||
let stderr_bufr = BufReader::new(stderr);
|
||||
for line in stderr_bufr.lines() {
|
||||
if let Ok(line) = line {
|
||||
let stdout_bufr = tokio::io::BufReader::new(stderr);
|
||||
for line in stdout_bufr.lines().next_line().await {
|
||||
if let Some(line) = line {
|
||||
println!("dagger: {}", line);
|
||||
}
|
||||
//panic!("could not start dagger session: {}", out)
|
||||
|
@@ -149,7 +149,7 @@ impl Downloader {
|
||||
let expected_checksum = self.expected_checksum().await?;
|
||||
|
||||
let mut bytes = vec![];
|
||||
let actual_hash = self.extract_cli_archive(&mut bytes)?;
|
||||
let actual_hash = self.extract_cli_archive(&mut bytes).await?;
|
||||
|
||||
if expected_checksum != actual_hash {
|
||||
eyre::bail!("downloaded CLI binary checksum doesn't match checksum from checksums.txt")
|
||||
@@ -190,17 +190,13 @@ impl Downloader {
|
||||
eyre::bail!("could not find a matching version or binary in checksums.txt")
|
||||
}
|
||||
|
||||
pub fn extract_cli_archive(&self, dest: &mut Vec<u8>) -> eyre::Result<String> {
|
||||
pub async fn extract_cli_archive(&self, dest: &mut Vec<u8>) -> eyre::Result<String> {
|
||||
let archive_url = self.archive_url();
|
||||
let resp = reqwest::blocking::get(&archive_url)?;
|
||||
let mut resp = resp.error_for_status()?;
|
||||
let mut bytes = vec![];
|
||||
let lines = resp.read_to_end(&mut bytes)?;
|
||||
if lines == 0 {
|
||||
eyre::bail!("nothing was downloaded")
|
||||
}
|
||||
let resp = reqwest::get(&archive_url).await?;
|
||||
let resp = resp.error_for_status()?;
|
||||
let bytes = resp.bytes().await?;
|
||||
let mut hasher = sha2::Sha256::new();
|
||||
hasher.update(bytes.as_slice());
|
||||
hasher.update(&bytes);
|
||||
let res = hasher.finalize();
|
||||
|
||||
println!("{}", hex::encode(&res));
|
||||
@@ -209,7 +205,7 @@ impl Downloader {
|
||||
// TODO: Nothing for now
|
||||
todo!()
|
||||
} else {
|
||||
self.extract_from_tar(bytes.as_slice(), dest)?;
|
||||
self.extract_from_tar(&bytes, dest)?;
|
||||
}
|
||||
|
||||
Ok(hex::encode(res))
|
||||
|
@@ -11,7 +11,7 @@ impl Engine {
|
||||
Self {}
|
||||
}
|
||||
|
||||
async fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, Child)> {
|
||||
async fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
let cli = Downloader::new("0.3.12".into())?.get_cli().await?;
|
||||
|
||||
let cli_session = CliSession::new();
|
||||
@@ -19,7 +19,7 @@ impl Engine {
|
||||
Ok(cli_session.connect(cfg, &cli).await?)
|
||||
}
|
||||
|
||||
pub async fn start(&self, cfg: &Config) -> eyre::Result<(ConnectParams, Child)> {
|
||||
pub async fn start(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
// TODO: Add from existing session as well
|
||||
self.from_cli(cfg).await
|
||||
}
|
||||
|
@@ -6,6 +6,58 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to
|
||||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## v0.2.12 (2023-02-20)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- <csr-id-a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de/> race condition in process
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 1 commit contributed to the release.
|
||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
### Commit Details
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- race condition in process ([`a13a2a9`](https://github.com/kjuulh/dagger-rs/commit/a13a2a9ecbfdfac80ed8eb0cbb9e9db317da65de))
|
||||
</details>
|
||||
|
||||
## v0.2.11 (2023-02-20)
|
||||
|
||||
<csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/>
|
||||
|
||||
### Chore
|
||||
|
||||
- <csr-id-803cfc4f8c4d72ab7d011be5523b3bfc6039de39/> ran clippy
|
||||
|
||||
### Commit Statistics
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 3 commits contributed to the release.
|
||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
### Commit Details
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`f869e57`](https://github.com/kjuulh/dagger-rs/commit/f869e574dd788cd60e5b1b5d502bec68e300694c))
|
||||
- Release dagger-core v0.2.4, dagger-codegen v0.2.6, dagger-sdk v0.2.11 ([`17ec62a`](https://github.com/kjuulh/dagger-rs/commit/17ec62a5d58232ff57391523b9851fb7b07d02ab))
|
||||
- ran clippy ([`803cfc4`](https://github.com/kjuulh/dagger-rs/commit/803cfc4f8c4d72ab7d011be5523b3bfc6039de39))
|
||||
</details>
|
||||
|
||||
## v0.2.10 (2023-02-20)
|
||||
|
||||
Alignment release
|
||||
@@ -18,7 +70,7 @@ Alignment release
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 7 commits contributed to the release.
|
||||
- 8 commits contributed to the release.
|
||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
|
||||
@@ -29,6 +81,7 @@ Alignment release
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **Uncategorized**
|
||||
- Release dagger-sdk v0.2.10 ([`5cb9729`](https://github.com/kjuulh/dagger-rs/commit/5cb97296b61677fb37e4bdb8519d30a484f93621))
|
||||
- changelog ([`b100285`](https://github.com/kjuulh/dagger-rs/commit/b100285312df522218bfd4bc00bbf41b857a81bf))
|
||||
- Adjusting changelogs prior to release of dagger-sdk v0.2.10 ([`8ed0647`](https://github.com/kjuulh/dagger-rs/commit/8ed06476e56f3290a419d2a67e7f25da575c63ad))
|
||||
- update changelog ([`09aa658`](https://github.com/kjuulh/dagger-rs/commit/09aa658b6fb3c1e9a2de668c4a69bbe5be13202f))
|
||||
|
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "dagger-sdk"
|
||||
version = "0.2.10"
|
||||
version = "0.2.12"
|
||||
edition = "2021"
|
||||
readme = "README.md"
|
||||
license-file = "LICENSE.MIT"
|
||||
@@ -11,7 +11,7 @@ publish = true
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
dagger-core = { path = "../dagger-core", version = "0.2.3" }
|
||||
dagger-core = { path = "../dagger-core", version = "^0.2.5" }
|
||||
|
||||
base64 = "0.21.0"
|
||||
eyre = "0.6.8"
|
||||
|
@@ -3,8 +3,8 @@ use crate::querybuilder::Selection;
|
||||
use dagger_core::connect_params::ConnectParams;
|
||||
use derive_builder::Builder;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::process::Child;
|
||||
use std::sync::Arc;
|
||||
use tokio::process::Child;
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
|
||||
pub struct CacheId(String);
|
||||
|
Reference in New Issue
Block a user