mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2025-02-25 08:51:29 +01:00
Compare commits
No commits in common. "62de24153aa75fcbdf20c1d754f533c7fa833a81" and "13b7805e7e6fcf47e0a1318adcc25b4ab773a3c9" have entirely different histories.
62de24153a
...
13b7805e7e
@ -1,12 +0,0 @@
|
||||
# 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.
|
@ -1,11 +0,0 @@
|
||||
# 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]]
|
||||
name = "dagger-core"
|
||||
version = "0.2.8"
|
||||
version = "0.2.7"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"dirs",
|
||||
@ -309,7 +309,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "dagger-sdk"
|
||||
version = "0.2.16"
|
||||
version = "0.2.15"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"dagger-core",
|
||||
|
@ -20,7 +20,7 @@ members = [
|
||||
|
||||
[dependencies]
|
||||
dagger-codegen = { path = "crates/dagger-codegen", version = "^0.2.5" }
|
||||
dagger-core = { path = "crates/dagger-core", version = "^0.2.8" }
|
||||
dagger-core = { path = "crates/dagger-core", version = "^0.2.7" }
|
||||
|
||||
clap = "4.1.6"
|
||||
dirs = "4.0.0"
|
||||
|
@ -1,43 +0,0 @@
|
||||
[tasks.codegen]
|
||||
command = "cargo"
|
||||
args = ["run", "-p", "ci", "--", "codegen"]
|
||||
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
Normal file
40
README.md
Normal file
@ -0,0 +1,40 @@
|
||||
# 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]
|
||||
clap = "4.1.6"
|
||||
color-eyre = "0.6.2"
|
||||
dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.16" }
|
||||
dagger-sdk = { path = "../crates/dagger-sdk/", version = "^0.2.15" }
|
||||
eyre = "0.6.8"
|
||||
tokio = { version = "1.25.0", features = ["full"] }
|
||||
|
@ -1,6 +1,5 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use clap::ArgMatches;
|
||||
use dagger_sdk::{Container, HostDirectoryOpts, Query};
|
||||
|
||||
#[tokio::main]
|
||||
@ -11,7 +10,6 @@ async fn main() -> eyre::Result<()> {
|
||||
.subcommand_required(true)
|
||||
.subcommand(clap::Command::new("pr"))
|
||||
.subcommand(clap::Command::new("release"))
|
||||
.subcommand(clap::Command::new("codegen"))
|
||||
.get_matches();
|
||||
|
||||
let client = dagger_sdk::connect().await?;
|
||||
@ -22,7 +20,6 @@ async fn main() -> eyre::Result<()> {
|
||||
return validate_pr(client, base).await;
|
||||
}
|
||||
Some(("release", subm)) => return release(client, subm).await,
|
||||
Some(("codegen", subm)) => return run_codegen(client, subm).await,
|
||||
Some(_) => {
|
||||
panic!("invalid subcommand selected!")
|
||||
}
|
||||
@ -32,42 +29,6 @@ async fn main() -> eyre::Result<()> {
|
||||
}
|
||||
}
|
||||
|
||||
async fn run_codegen(client: Arc<Query>, _subm: &ArgMatches) -> eyre::Result<()> {
|
||||
let docker_cli = client
|
||||
.container()
|
||||
.from("docker:cli")
|
||||
.file("/usr/local/bin/docker");
|
||||
let socket = client.host().unix_socket("/var/run/docker.sock");
|
||||
|
||||
let container = get_dependencies(client).await?;
|
||||
|
||||
let generated_image = container
|
||||
.with_exec(vec!["mkdir", "-p", "/mnt/output"])
|
||||
.with_mounted_file("/usr/bin/docker", docker_cli.id().await?)
|
||||
.with_unix_socket("/var/run/docker.sock", socket.id().await?)
|
||||
.with_exec(vec![
|
||||
"cargo",
|
||||
"run",
|
||||
"--",
|
||||
"generate",
|
||||
"--output",
|
||||
"crates/dagger-sdk/gen.rs",
|
||||
])
|
||||
.with_exec(vec!["cargo", "fmt", "--all"])
|
||||
.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"]);
|
||||
|
||||
let _ = generated_image.exit_code().await?;
|
||||
|
||||
generated_image
|
||||
.file("/mnt/output/gen.rs")
|
||||
.export("crates/dagger-sdk/src/gen.rs")
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn release(client: Arc<Query>, _subm: &clap::ArgMatches) -> Result<(), color_eyre::Report> {
|
||||
let src_dir = client.host().directory_opts(
|
||||
".",
|
||||
@ -126,14 +87,14 @@ async fn get_dependencies(client: Arc<Query>) -> eyre::Result<Container> {
|
||||
);
|
||||
|
||||
let cache_cargo_index_dir = client.cache_volume("cargo_index");
|
||||
let _cache_cargo_deps = client.cache_volume("cargo_deps");
|
||||
let cache_cargo_deps = client.cache_volume("cargo_deps");
|
||||
let cache_cargo_bin = client.cache_volume("cargo_bin_cache");
|
||||
|
||||
let minio_url = "https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-unknown-linux-musl.tar.gz";
|
||||
|
||||
let base_image = client
|
||||
.container()
|
||||
.from("rustlang/rust:nightly")
|
||||
.from("rust:latest")
|
||||
.with_workdir("app")
|
||||
.with_exec(vec!["apt-get", "update"])
|
||||
.with_exec(vec!["apt-get", "install", "--yes", "libpq-dev", "wget"])
|
||||
@ -149,7 +110,7 @@ async fn get_dependencies(client: Arc<Query>) -> eyre::Result<Container> {
|
||||
"/usr/local/bin/sccache",
|
||||
])
|
||||
.with_exec(vec!["chmod", "+x", "/usr/local/bin/sccache"])
|
||||
//.with_env_variable("RUSTC_WRAPPER", "/usr/local/bin/sccache")
|
||||
.with_env_variable("RUSTC_WRAPPER", "/usr/local/bin/sccache")
|
||||
.with_env_variable(
|
||||
"AWS_ACCESS_KEY_ID",
|
||||
std::env::var("AWS_ACCESS_KEY_ID").unwrap_or("".into()),
|
||||
@ -191,7 +152,8 @@ async fn get_dependencies(client: Arc<Query>) -> eyre::Result<Container> {
|
||||
"--recipe-path",
|
||||
"recipe.json",
|
||||
])
|
||||
.with_directory("/app/", src_dir.id().await?)
|
||||
.with_mounted_cache("/app/", cache_cargo_deps.id().await?)
|
||||
.with_mounted_directory("/app/", src_dir.id().await?)
|
||||
.with_exec(vec!["cargo", "build", "--all", "--release"]);
|
||||
|
||||
return Ok(builder_start);
|
||||
|
@ -11,7 +11,7 @@ publish = true
|
||||
|
||||
[dependencies]
|
||||
convert_case = "0.6.0"
|
||||
dagger-core = { path = "../dagger-core", version = "^0.2.8" }
|
||||
dagger-core = { path = "../dagger-core", version = "^0.2.7" }
|
||||
|
||||
eyre = "0.6.8"
|
||||
genco = "0.17.3"
|
||||
|
@ -5,42 +5,6 @@ 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.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)
|
||||
|
||||
### New Features
|
||||
@ -51,7 +15,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.
|
||||
- 1 commit contributed to the release.
|
||||
- 4 days passed between releases.
|
||||
- 1 commit was understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
@ -63,7 +27,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **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))
|
||||
</details>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "dagger-core"
|
||||
version = "0.2.8"
|
||||
version = "0.2.7"
|
||||
edition = "2021"
|
||||
readme = "README.md"
|
||||
license-file = "LICENSE.MIT"
|
||||
|
@ -1,4 +1,3 @@
|
||||
use crate::DAGGER_ENGINE_VERSION;
|
||||
use crate::{
|
||||
cli_session::CliSession, config::Config, connect_params::ConnectParams, downloader::Downloader,
|
||||
};
|
||||
@ -11,9 +10,7 @@ impl Engine {
|
||||
}
|
||||
|
||||
async fn from_cli(&self, cfg: &Config) -> eyre::Result<(ConnectParams, tokio::process::Child)> {
|
||||
let cli = Downloader::new(DAGGER_ENGINE_VERSION.into())?
|
||||
.get_cli()
|
||||
.await?;
|
||||
let cli = Downloader::new("0.3.13".into())?.get_cli().await?;
|
||||
|
||||
let cli_session = CliSession::new();
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
#![deny(warnings)]
|
||||
|
||||
pub const DAGGER_ENGINE_VERSION: &'static str = "0.4.0";
|
||||
|
||||
pub mod cli_session;
|
||||
pub mod config;
|
||||
pub mod connect_params;
|
||||
|
@ -6,52 +6,6 @@ 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.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)
|
||||
|
||||
### New Features
|
||||
@ -66,7 +20,7 @@ and this project adheres to
|
||||
|
||||
<csr-read-only-do-not-edit/>
|
||||
|
||||
- 3 commits contributed to the release.
|
||||
- 2 commits contributed to the release.
|
||||
- 2 days passed between releases.
|
||||
- 2 commits were understood as [conventional](https://www.conventionalcommits.org).
|
||||
- 0 issues like '(#ID)' were seen in commit messages
|
||||
@ -78,7 +32,6 @@ and this project adheres to
|
||||
<details><summary>view details</summary>
|
||||
|
||||
* **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))
|
||||
- update to dagger-v0.3.13 ([`3e8ca8d`](https://github.com/kjuulh/dagger-rs/commit/3e8ca8d86eafdc1f9d5e8b69f14fb60509549e0f))
|
||||
</details>
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "dagger-sdk"
|
||||
version = "0.2.16"
|
||||
version = "0.2.15"
|
||||
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.8" }
|
||||
dagger-core = { path = "../dagger-core", version = "^0.2.7" }
|
||||
|
||||
base64 = "0.21.0"
|
||||
eyre = "0.6.8"
|
||||
|
@ -22,11 +22,6 @@ pub struct SecretId(String);
|
||||
pub struct SocketId(String);
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
|
||||
pub struct BuildArg {
|
||||
pub value: String,
|
||||
pub name: String,
|
||||
}
|
||||
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
|
||||
pub struct PipelineLabel {
|
||||
pub name: String,
|
||||
pub value: String,
|
||||
}
|
||||
@ -102,12 +97,8 @@ pub struct ContainerExportOpts {
|
||||
}
|
||||
#[derive(Builder, Debug, PartialEq)]
|
||||
pub struct ContainerPipelineOpts<'a> {
|
||||
/// Pipeline description.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub description: Option<&'a str>,
|
||||
/// Pipeline labels.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub labels: Option<Vec<PipelineLabel>>,
|
||||
}
|
||||
#[derive(Builder, Debug, PartialEq)]
|
||||
pub struct ContainerPublishOpts {
|
||||
@ -147,12 +138,6 @@ pub struct ContainerWithExecOpts<'a> {
|
||||
/// The command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub experimental_privileged_nesting: Option<bool>,
|
||||
/// Execute the command with all root capabilities. This is similar to running a command
|
||||
/// with "sudo" or executing `docker run` with the `--privileged` flag. Containerization
|
||||
/// does not provide any security guarantees when using this option. It should only be used
|
||||
/// when absolutely necessary and only with trusted commands.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub insecure_root_capabilities: Option<bool>,
|
||||
}
|
||||
#[derive(Builder, Debug, PartialEq)]
|
||||
pub struct ContainerWithExposedPortOpts<'a> {
|
||||
@ -267,7 +252,6 @@ impl Container {
|
||||
/// Retrieves an endpoint that clients can use to reach this container.
|
||||
/// If no port is specified, the first exposed port is used. If none exist an error is returned.
|
||||
/// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -281,7 +265,6 @@ impl Container {
|
||||
/// Retrieves an endpoint that clients can use to reach this container.
|
||||
/// If no port is specified, the first exposed port is used. If none exist an error is returned.
|
||||
/// If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -375,7 +358,7 @@ impl Container {
|
||||
};
|
||||
}
|
||||
/// Exit code of the last executed command. Zero means success.
|
||||
/// Errors if no command has been executed.
|
||||
/// Null if no command has been executed.
|
||||
pub async fn exit_code(&self) -> eyre::Result<isize> {
|
||||
let query = self.selection.select("exitCode");
|
||||
|
||||
@ -421,8 +404,7 @@ impl Container {
|
||||
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// Retrieves the list of exposed ports.
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
/// Retrieves the list of exposed ports
|
||||
pub fn exposed_ports(&self) -> Vec<Port> {
|
||||
let query = self.selection.select("exposedPorts");
|
||||
|
||||
@ -478,7 +460,6 @@ impl Container {
|
||||
};
|
||||
}
|
||||
/// Retrieves a hostname which can be used by clients to reach this container.
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
pub async fn hostname(&self) -> eyre::Result<String> {
|
||||
let query = self.selection.select("hostname");
|
||||
|
||||
@ -524,7 +505,6 @@ impl Container {
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Pipeline name.
|
||||
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn pipeline(&self, name: impl Into<String>) -> Container {
|
||||
let mut query = self.selection.select("pipeline");
|
||||
@ -542,7 +522,6 @@ impl Container {
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Pipeline name.
|
||||
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn pipeline_opts<'a>(
|
||||
&self,
|
||||
@ -555,9 +534,6 @@ impl Container {
|
||||
if let Some(description) = opts.description {
|
||||
query = query.arg("description", description);
|
||||
}
|
||||
if let Some(labels) = opts.labels {
|
||||
query = query.arg("labels", labels);
|
||||
}
|
||||
|
||||
return Container {
|
||||
proc: self.proc.clone(),
|
||||
@ -624,14 +600,14 @@ impl Container {
|
||||
};
|
||||
}
|
||||
/// The error stream of the last executed command.
|
||||
/// Errors if no command has been executed.
|
||||
/// Null if no command has been executed.
|
||||
pub async fn stderr(&self) -> eyre::Result<String> {
|
||||
let query = self.selection.select("stderr");
|
||||
|
||||
query.execute(&graphql_client(&self.conn)).await
|
||||
}
|
||||
/// The output stream of the last executed command.
|
||||
/// Errors if no command has been executed.
|
||||
/// Null if no command has been executed.
|
||||
pub async fn stdout(&self) -> eyre::Result<String> {
|
||||
let query = self.selection.select("stdout");
|
||||
|
||||
@ -820,9 +796,6 @@ impl Container {
|
||||
experimental_privileged_nesting,
|
||||
);
|
||||
}
|
||||
if let Some(insecure_root_capabilities) = opts.insecure_root_capabilities {
|
||||
query = query.arg("insecureRootCapabilities", insecure_root_capabilities);
|
||||
}
|
||||
|
||||
return Container {
|
||||
proc: self.proc.clone(),
|
||||
@ -834,7 +807,6 @@ impl Container {
|
||||
/// Exposed ports serve two purposes:
|
||||
/// - For health checks and introspection, when running services
|
||||
/// - For setting the EXPOSE OCI field when publishing the container
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -856,7 +828,6 @@ impl Container {
|
||||
/// Exposed ports serve two purposes:
|
||||
/// - For health checks and introspection, when running services
|
||||
/// - For setting the EXPOSE OCI field when publishing the container
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -1188,7 +1159,6 @@ impl Container {
|
||||
/// Establish a runtime dependency on a service. The service will be started automatically when needed and detached when it is no longer needed.
|
||||
/// The service will be reachable from the container via the provided hostname alias.
|
||||
/// The service dependency will also convey to any files or directories produced by the container.
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -1277,7 +1247,6 @@ impl Container {
|
||||
};
|
||||
}
|
||||
/// Unexpose a previously exposed port.
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -1296,7 +1265,6 @@ impl Container {
|
||||
}
|
||||
|
||||
/// Unexpose a previously exposed port.
|
||||
/// Currently experimental; set _EXPERIMENTAL_DAGGER_SERVICES_DNS=0 to disable.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@ -1423,12 +1391,8 @@ pub struct DirectoryEntriesOpts<'a> {
|
||||
}
|
||||
#[derive(Builder, Debug, PartialEq)]
|
||||
pub struct DirectoryPipelineOpts<'a> {
|
||||
/// Pipeline description.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub description: Option<&'a str>,
|
||||
/// Pipeline labels.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub labels: Option<Vec<PipelineLabel>>,
|
||||
}
|
||||
#[derive(Builder, Debug, PartialEq)]
|
||||
pub struct DirectoryWithDirectoryOpts<'a> {
|
||||
@ -1610,11 +1574,10 @@ impl Directory {
|
||||
conn: self.conn.clone(),
|
||||
};
|
||||
}
|
||||
/// Creates a named sub-pipeline
|
||||
/// Creates a named sub-pipeline.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Pipeline name.
|
||||
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn pipeline(&self, name: impl Into<String>) -> Directory {
|
||||
let mut query = self.selection.select("pipeline");
|
||||
@ -1628,11 +1591,10 @@ impl Directory {
|
||||
};
|
||||
}
|
||||
|
||||
/// Creates a named sub-pipeline
|
||||
/// Creates a named sub-pipeline.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Pipeline name.
|
||||
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn pipeline_opts<'a>(
|
||||
&self,
|
||||
@ -1645,9 +1607,6 @@ impl Directory {
|
||||
if let Some(description) = opts.description {
|
||||
query = query.arg("description", description);
|
||||
}
|
||||
if let Some(labels) = opts.labels {
|
||||
query = query.arg("labels", labels);
|
||||
}
|
||||
|
||||
return Directory {
|
||||
proc: self.proc.clone(),
|
||||
@ -2411,12 +2370,8 @@ pub struct QueryHttpOpts {
|
||||
}
|
||||
#[derive(Builder, Debug, PartialEq)]
|
||||
pub struct QueryPipelineOpts<'a> {
|
||||
/// Pipeline description.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub description: Option<&'a str>,
|
||||
/// Pipeline labels.
|
||||
#[builder(setter(into, strip_option), default)]
|
||||
pub labels: Option<Vec<PipelineLabel>>,
|
||||
}
|
||||
#[derive(Builder, Debug, PartialEq)]
|
||||
pub struct QuerySocketOpts {
|
||||
@ -2627,11 +2582,10 @@ impl Query {
|
||||
conn: self.conn.clone(),
|
||||
};
|
||||
}
|
||||
/// Creates a named sub-pipeline.
|
||||
/// Creates a named sub-pipeline
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Pipeline name.
|
||||
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn pipeline(&self, name: impl Into<String>) -> Query {
|
||||
let mut query = self.selection.select("pipeline");
|
||||
@ -2645,11 +2599,10 @@ impl Query {
|
||||
};
|
||||
}
|
||||
|
||||
/// Creates a named sub-pipeline.
|
||||
/// Creates a named sub-pipeline
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Pipeline name.
|
||||
/// * `opt` - optional argument, see inner type for documentation, use <func>_opts to use
|
||||
pub fn pipeline_opts<'a>(&self, name: impl Into<String>, opts: QueryPipelineOpts<'a>) -> Query {
|
||||
let mut query = self.selection.select("pipeline");
|
||||
@ -2658,9 +2611,6 @@ impl Query {
|
||||
if let Some(description) = opts.description {
|
||||
query = query.arg("description", description);
|
||||
}
|
||||
if let Some(labels) = opts.labels {
|
||||
query = query.arg("labels", labels);
|
||||
}
|
||||
|
||||
return Query {
|
||||
proc: self.proc.clone(),
|
||||
@ -2764,9 +2714,9 @@ impl Socket {
|
||||
}
|
||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||
pub enum CacheSharingMode {
|
||||
SHARED,
|
||||
PRIVATE,
|
||||
LOCKED,
|
||||
SHARED,
|
||||
}
|
||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
||||
pub enum NetworkProtocol {
|
||||
|
@ -1,4 +1,4 @@
|
||||
use dagger_sdk::{connect, ContainerExecOptsBuilder};
|
||||
use dagger_sdk::{connect, ContainerExecOpts, ContainerExecOptsBuilder};
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
#[tokio::test]
|
||||
|
Loading…
x
Reference in New Issue
Block a user