mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-12-30 11:31:02 +01:00
Compare commits
7 Commits
feat/dagge
...
62de24153a
| Author | SHA1 | Date | |
|---|---|---|---|
|
62de24153a
|
|||
|
9513bb5653
|
|||
|
6b43d5bc36
|
|||
|
f390eac29f
|
|||
|
e642778d90
|
|||
| 7133bfae95 | |||
| 41b20b6268 |
12
ARCHITECTURE.md
Normal file
12
ARCHITECTURE.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# Architecture
|
||||||
|
|
||||||
|
- `.` Root project mainly used for generating the CLI, which in turn is used to
|
||||||
|
bootstrap the code generation from `dagger`
|
||||||
|
- `crates/dagger-core` Contains all base types used during actual usage. This is
|
||||||
|
where the primary logic lives in which the user interacts (\*disclaimer: most
|
||||||
|
stuff haven't moved in here yet.)
|
||||||
|
- `crates/dagger-sdk` Contains the actual sdk in which the user interacts,
|
||||||
|
`dagger-core` is reexported through this API as well.
|
||||||
|
- `crates/dagger-codegen` This is the bulk of the work, it takes the input
|
||||||
|
graphql and spits out the API in which the user interacts, this is heavily
|
||||||
|
inspired by other `dagger-sdk's`. It primarily turns graphql into rust code.
|
||||||
11
CONTRIBUTING.md
Normal file
11
CONTRIBUTING.md
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
The sdk is still quite young, so feel free to either:
|
||||||
|
|
||||||
|
- Refactor
|
||||||
|
- Document
|
||||||
|
- Improve the code
|
||||||
|
|
||||||
|
Feel free to ping me on discord @Hermansen#4325, or just create an issue if
|
||||||
|
there is a missing feature, or you'd like some mentorship in getting into the
|
||||||
|
code
|
||||||
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -260,7 +260,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-core"
|
name = "dagger-core"
|
||||||
version = "0.2.7"
|
version = "0.2.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"dirs",
|
"dirs",
|
||||||
@@ -309,7 +309,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dagger-sdk"
|
name = "dagger-sdk"
|
||||||
version = "0.2.15"
|
version = "0.2.16"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"dagger-core",
|
"dagger-core",
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ members = [
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.5" }
|
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.5" }
|
||||||
dagger-core = { path = "crates/dagger-core", version = "^0.2.7" }
|
dagger-core = { path = "crates/dagger-core", version = "^0.2.8" }
|
||||||
|
|
||||||
clap = "4.1.6"
|
clap = "4.1.6"
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
|
|||||||
@@ -2,3 +2,42 @@
|
|||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["run", "-p", "ci", "--", "codegen"]
|
args = ["run", "-p", "ci", "--", "codegen"]
|
||||||
workspace = false
|
workspace = false
|
||||||
|
|
||||||
|
[tasks.build]
|
||||||
|
command = "cargo"
|
||||||
|
args = ["run", "-p", "ci", "--", "ci"]
|
||||||
|
dependencies = ["codegen"]
|
||||||
|
workspace = false
|
||||||
|
|
||||||
|
[tasks.fmt]
|
||||||
|
command = "cargo"
|
||||||
|
args = ["fmt", "--all"]
|
||||||
|
workspace = false
|
||||||
|
|
||||||
|
[tasks.fix]
|
||||||
|
command = "cargo"
|
||||||
|
args = ["fix", "--workspace", "--allow-dirty"]
|
||||||
|
dependencies = ["fmt"]
|
||||||
|
workspace = false
|
||||||
|
|
||||||
|
[tasks.release_crate]
|
||||||
|
command = "cargo"
|
||||||
|
args = [
|
||||||
|
"smart-release",
|
||||||
|
"--allow-fully-generated-changelogs",
|
||||||
|
"--update-crates-index",
|
||||||
|
"dagger-sdk",
|
||||||
|
]
|
||||||
|
dependencies = ["codegen", "fix"]
|
||||||
|
workspace = false
|
||||||
|
|
||||||
|
[tasks.release_crate_commit]
|
||||||
|
command = "cargo"
|
||||||
|
args = [
|
||||||
|
"smart-release",
|
||||||
|
"-e",
|
||||||
|
"--allow-fully-generated-changelogs",
|
||||||
|
"--update-crates-index",
|
||||||
|
"dagger-sdk",
|
||||||
|
]
|
||||||
|
workspace = false
|
||||||
|
|||||||
40
README.md
40
README.md
@@ -1,40 +0,0 @@
|
|||||||
# dagger-rs
|
|
||||||
|
|
||||||
A dagger sdk written in rust for rust.
|
|
||||||
|
|
||||||
# Usage
|
|
||||||
|
|
||||||
See [dagger-sdk](./crates/dagger-sdk/README.md)
|
|
||||||
|
|
||||||
### Status
|
|
||||||
|
|
||||||
- [x] dagger cli downloader
|
|
||||||
- [x] dagger network session
|
|
||||||
- [x] graphql rust codegen (User API)
|
|
||||||
- [x] Scalars
|
|
||||||
- [x] Enums
|
|
||||||
- [x] Input
|
|
||||||
- [x] Objects
|
|
||||||
- [x] Implement context and querier
|
|
||||||
- [x] Marshaller
|
|
||||||
- [x] Querier
|
|
||||||
- [x] Context
|
|
||||||
- [x] Deserializer for nested response (bind)
|
|
||||||
- [x] Add codegen to hook into querier
|
|
||||||
- [x] fix build / release cycle
|
|
||||||
- [x] general api stabilisation
|
|
||||||
- [x] document usage
|
|
||||||
- [x] make async variant
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
- `.` Root project mainly used for generating the CLI, which in turn is used to
|
|
||||||
bootstrap the code generation from `dagger`
|
|
||||||
- `crates/dagger-core` Contains all base types used during actual usage. This is
|
|
||||||
where the primary logic lives in which the user interacts (\*disclaimer: most
|
|
||||||
stuff haven't moved in here yet.)
|
|
||||||
- `crates/dagger-sdk` Contains the actual sdk in which the user interacts,
|
|
||||||
`dagger-core` is reexported through this API as well.
|
|
||||||
- `crates/dagger-codegen` This is the bulk of the work, it takes the input
|
|
||||||
graphql and spits out the API in which the user interacts, this is heavily
|
|
||||||
inspired by other `dagger-sdk's`. It primarily turns graphql into rust code.
|
|
||||||
@@ -8,6 +8,6 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
clap = "4.1.6"
|
clap = "4.1.6"
|
||||||
color-eyre = "0.6.2"
|
color-eyre = "0.6.2"
|
||||||
dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.15" }
|
dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.16" }
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
tokio = { version = "1.25.0", features = ["full"] }
|
tokio = { version = "1.25.0", features = ["full"] }
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ async fn run_codegen(client: Arc<Query>, _subm: &ArgMatches) -> eyre::Result<()>
|
|||||||
])
|
])
|
||||||
.with_exec(vec!["cargo", "fmt", "--all"])
|
.with_exec(vec!["cargo", "fmt", "--all"])
|
||||||
.with_exec(vec!["cargo", "fix", "--workspace", "--allow-dirty"])
|
.with_exec(vec!["cargo", "fix", "--workspace", "--allow-dirty"])
|
||||||
|
.with_exec(vec!["cargo", "fmt", "--all"])
|
||||||
.with_exec(vec!["mv", "crates/dagger-sdk/gen.rs", "/mnt/output/gen.rs"]);
|
.with_exec(vec!["mv", "crates/dagger-sdk/gen.rs", "/mnt/output/gen.rs"]);
|
||||||
|
|
||||||
let _ = generated_image.exit_code().await?;
|
let _ = generated_image.exit_code().await?;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ publish = true
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
convert_case = "0.6.0"
|
convert_case = "0.6.0"
|
||||||
dagger-core = { path = "../dagger-core", version = "^0.2.7" }
|
dagger-core = { path = "../dagger-core", version = "^0.2.8" }
|
||||||
|
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
genco = "0.17.3"
|
genco = "0.17.3"
|
||||||
|
|||||||
@@ -5,6 +5,42 @@ 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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.2.8 (2023-03-10)
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- <csr-id-41b20b6268db9d8defe333694e4d3ec019d7c923/> bump version
|
||||||
|
- <csr-id-5f9b3a19c0ab6988bc335b020052074f3f101305/> set internal warnings as errors
|
||||||
|
- <csr-id-f9e7af931d94fbedacf74f5da9a2f71b1992324b/> introduce tests again
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- <csr-id-ecca036bc644fee93fbcb69bf6da9f29169e473e/> fix builder pattern to actually work with default values
|
||||||
|
In previous versions the builder pattern required all values to be set.
|
||||||
|
This has not been fixed, so that default values are allowed.
|
||||||
|
|
||||||
|
### Commit Statistics
|
||||||
|
|
||||||
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
|
- 4 commits contributed to the release over the course of 13 calendar days.
|
||||||
|
- 13 days passed between releases.
|
||||||
|
- 4 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**
|
||||||
|
- bump version ([`41b20b6`](https://github.com/kjuulh/dagger-rs/commit/41b20b6268db9d8defe333694e4d3ec019d7c923))
|
||||||
|
- set internal warnings as errors ([`5f9b3a1`](https://github.com/kjuulh/dagger-rs/commit/5f9b3a19c0ab6988bc335b020052074f3f101305))
|
||||||
|
- introduce tests again ([`f9e7af9`](https://github.com/kjuulh/dagger-rs/commit/f9e7af931d94fbedacf74f5da9a2f71b1992324b))
|
||||||
|
- fix builder pattern to actually work with default values ([`ecca036`](https://github.com/kjuulh/dagger-rs/commit/ecca036bc644fee93fbcb69bf6da9f29169e473e))
|
||||||
|
</details>
|
||||||
|
|
||||||
## v0.2.7 (2023-02-24)
|
## v0.2.7 (2023-02-24)
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
@@ -15,7 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
- 1 commit contributed to the release.
|
- 2 commits contributed to the release.
|
||||||
- 4 days passed between releases.
|
- 4 days passed between releases.
|
||||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||||
- 0 issues like '(#ID)' were seen in commit messages
|
- 0 issues like '(#ID)' were seen in commit messages
|
||||||
@@ -27,6 +63,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
<details><summary>view details</summary>
|
<details><summary>view details</summary>
|
||||||
|
|
||||||
* **Uncategorized**
|
* **Uncategorized**
|
||||||
|
- Release dagger-core v0.2.7, dagger-sdk v0.2.15 ([`6a9a560`](https://github.com/kjuulh/dagger-rs/commit/6a9a560cdca097abf23371d44599a2f1b726ae7f))
|
||||||
- update to dagger-v0.3.13 ([`3e8ca8d`](https://github.com/kjuulh/dagger-rs/commit/3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f))
|
- update to dagger-v0.3.13 ([`3e8ca8d`](https://github.com/kjuulh/dagger-rs/commit/3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f))
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dagger-core"
|
name = "dagger-core"
|
||||||
version = "0.2.7"
|
version = "0.2.8"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license-file = "LICENSE.MIT"
|
license-file = "LICENSE.MIT"
|
||||||
|
|||||||
@@ -6,6 +6,52 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
and this project adheres to
|
and this project adheres to
|
||||||
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## v0.2.16 (2023-03-10)
|
||||||
|
|
||||||
|
### Chore
|
||||||
|
|
||||||
|
- <csr-id-e642778d9028726dfb07217814e15ad1dd3b83f2/> fix tasks
|
||||||
|
|
||||||
|
### Documentation
|
||||||
|
|
||||||
|
- <csr-id-13b7805e7e6fcf47e0a1318adcc25b4ab773a3c9/> fix missing await in connect
|
||||||
|
|
||||||
|
### New Features
|
||||||
|
|
||||||
|
- <csr-id-7133bfae9508bc5977548e373c49342a1248d6e4/> with dagger-engine v.0.4.0
|
||||||
|
- <csr-id-4381af029521c2cbac9325278d261db79a994657/> add tests to sdk
|
||||||
|
- <csr-id-5f9b3a19c0ab6988bc335b020052074f3f101305/> set internal warnings as errors
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
- <csr-id-ecca036bc644fee93fbcb69bf6da9f29169e473e/> fix builder pattern to actually work with default values
|
||||||
|
In previous versions the builder pattern required all values to be set.
|
||||||
|
This has not been fixed, so that default values are allowed.
|
||||||
|
|
||||||
|
### Commit Statistics
|
||||||
|
|
||||||
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
|
- 6 commits contributed to the release over the course of 13 calendar days.
|
||||||
|
- 13 days passed between releases.
|
||||||
|
- 6 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**
|
||||||
|
- fix tasks ([`e642778`](https://github.com/kjuulh/dagger-rs/commit/e642778d9028726dfb07217814e15ad1dd3b83f2))
|
||||||
|
- with dagger-engine v.0.4.0 ([`7133bfa`](https://github.com/kjuulh/dagger-rs/commit/7133bfae9508bc5977548e373c49342a1248d6e4))
|
||||||
|
- fix missing await in connect ([`13b7805`](https://github.com/kjuulh/dagger-rs/commit/13b7805e7e6fcf47e0a1318adcc25b4ab773a3c9))
|
||||||
|
- add tests to sdk ([`4381af0`](https://github.com/kjuulh/dagger-rs/commit/4381af029521c2cbac9325278d261db79a994657))
|
||||||
|
- set internal warnings as errors ([`5f9b3a1`](https://github.com/kjuulh/dagger-rs/commit/5f9b3a19c0ab6988bc335b020052074f3f101305))
|
||||||
|
- fix builder pattern to actually work with default values ([`ecca036`](https://github.com/kjuulh/dagger-rs/commit/ecca036bc644fee93fbcb69bf6da9f29169e473e))
|
||||||
|
</details>
|
||||||
|
|
||||||
## v0.2.15 (2023-02-24)
|
## v0.2.15 (2023-02-24)
|
||||||
|
|
||||||
### New Features
|
### New Features
|
||||||
@@ -20,7 +66,7 @@ and this project adheres to
|
|||||||
|
|
||||||
<csr-read-only-do-not-edit/>
|
<csr-read-only-do-not-edit/>
|
||||||
|
|
||||||
- 2 commits contributed to the release.
|
- 3 commits contributed to the release.
|
||||||
- 2 days passed between releases.
|
- 2 days passed between releases.
|
||||||
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
|
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
|
||||||
- 0 issues like '(#ID)' were seen in commit messages
|
- 0 issues like '(#ID)' were seen in commit messages
|
||||||
@@ -32,6 +78,7 @@ and this project adheres to
|
|||||||
<details><summary>view details</summary>
|
<details><summary>view details</summary>
|
||||||
|
|
||||||
* **Uncategorized**
|
* **Uncategorized**
|
||||||
|
- Release dagger-core v0.2.7, dagger-sdk v0.2.15 ([`6a9a560`](https://github.com/kjuulh/dagger-rs/commit/6a9a560cdca097abf23371d44599a2f1b726ae7f))
|
||||||
- set deserialize on enums as well ([`e578b0e`](https://github.com/kjuulh/dagger-rs/commit/e578b0e371e13bc30ada793b7cd6ebe75ba83a07))
|
- set deserialize on enums as well ([`e578b0e`](https://github.com/kjuulh/dagger-rs/commit/e578b0e371e13bc30ada793b7cd6ebe75ba83a07))
|
||||||
- update to dagger-v0.3.13 ([`3e8ca8d`](https://github.com/kjuulh/dagger-rs/commit/3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f))
|
- update to dagger-v0.3.13 ([`3e8ca8d`](https://github.com/kjuulh/dagger-rs/commit/3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f))
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "dagger-sdk"
|
name = "dagger-sdk"
|
||||||
version = "0.2.15"
|
version = "0.2.16"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license-file = "LICENSE.MIT"
|
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
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dagger-core = { path = "../dagger-core", version = "^0.2.7" }
|
dagger-core = { path = "../dagger-core", version = "^0.2.8" }
|
||||||
|
|
||||||
base64 = "0.21.0"
|
base64 = "0.21.0"
|
||||||
eyre = "0.6.8"
|
eyre = "0.6.8"
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ pub struct SecretId(String);
|
|||||||
pub struct SocketId(String);
|
pub struct SocketId(String);
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
|
||||||
pub struct BuildArg {
|
pub struct BuildArg {
|
||||||
pub name: String,
|
|
||||||
pub value: String,
|
pub value: String,
|
||||||
|
pub name: String,
|
||||||
}
|
}
|
||||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
|
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
|
||||||
pub struct PipelineLabel {
|
pub struct PipelineLabel {
|
||||||
pub value: String,
|
|
||||||
pub name: String,
|
pub name: String,
|
||||||
|
pub value: String,
|
||||||
}
|
}
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct CacheVolume {
|
pub struct CacheVolume {
|
||||||
@@ -2764,12 +2764,12 @@ impl Socket {
|
|||||||
}
|
}
|
||||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||||
pub enum CacheSharingMode {
|
pub enum CacheSharingMode {
|
||||||
|
PRIVATE,
|
||||||
LOCKED,
|
LOCKED,
|
||||||
SHARED,
|
SHARED,
|
||||||
PRIVATE,
|
|
||||||
}
|
}
|
||||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||||
pub enum NetworkProtocol {
|
pub enum NetworkProtocol {
|
||||||
TCP,
|
|
||||||
UDP,
|
UDP,
|
||||||
|
TCP,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user