Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to hyper 1.1 #363

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- run: docker run -h test.example.com --volumes-from certs -d --privileged --name test-docker-daemon docker:stable-dind --storage-driver=overlay --tlsverify --tlscacert=/certs/ca.pem --tlscert=/certs/cert.pem --tlskey=/certs/key.pem
- run: docker run --rm --volumes-from certs --privileged --rm --entrypoint=chmod docker:stable-dind 644 /certs/key.pem /certs/ca-key.pem
- run: docker build -t bollard .
- run: docker run -ti -e DOCKER_CERT_PATH=/certs -e DOCKER_HOST='tcp://test.example.com:2376' --volumes-from certs --rm --link test-docker-daemon:docker bollard cargo test --features test_ssl,ct_logs -- --test test_version_ssl
- run: docker run -ti -e DOCKER_CERT_PATH=/certs -e DOCKER_HOST='tcp://test.example.com:2376' --volumes-from certs --rm --link test-docker-daemon:docker bollard cargo test --features test_ssl,webpki -- --test test_version_ssl
test_http:
docker:
- image: docker:24.0.5
Expand Down
39 changes: 20 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ members = [
]

[features]
default = []
# Enable Buildkit-enabled docker image building
buildkit = ["chrono", "num", "rand", "tokio/fs", "tokio-stream", "tokio-util/io", "tower", "tonic", "tower-service", "ssl", "bollard-stubs/buildkit", "bollard-buildkit-proto"]
buildkit = ["chrono", "num", "rand", "tokio/fs", "tokio-util/io", "tonic", "tower-service", "ssl", "bollard-stubs/buildkit", "bollard-buildkit-proto"]
# Enable tests specifically for the http connector
test_http = []
# Enable tests specifically for rustls
Expand All @@ -30,63 +31,63 @@ test_macos = []
# Enable JSON payload in deserialization errors
json_data_content = []
# Enable rustls / ssl
ssl = ["home", "hyper-rustls", "rustls", "rustls-native-certs", "rustls-pemfile", "webpki", "webpki-roots"]
ct_logs = ["ssl", "ct-logs"]
ssl = ["home", "hyper-rustls", "rustls", "rustls-native-certs", "rustls-pemfile", "rustls-pki-types"]
webpki = ["ssl", "dep:webpki-roots"]
chrono = ["dep:chrono", "bollard-stubs/chrono"]
time = ["dep:time", "bollard-stubs/time"]

[dependencies]
base64 = "0.21"
bollard-stubs = { path = "codegen/swagger", version = "=1.43.0-rc.2", default-features = false }
bollard-buildkit-proto = { path = "codegen/proto", version = "=0.2.0", optional = true }
bollard-stubs = { path = "codegen/swagger", version = "=1.44.0-rc.1", default-features = false }
bollard-buildkit-proto = { path = "codegen/proto", version = "=0.2.1", optional = true }
bytes = "1"
chrono = { version = "0.4", default-features = false, features = ["std", "clock", "serde"], optional = true }
ct-logs = { version = "0.9.0", optional = true }
home = { version = "0.5", optional = true }
futures-core = "0.3"
futures-util = "0.3"
hex = "0.4.2"
http = "0.2"
hyper = { version = "0.14", features = ["client", "tcp", "http1", "http2", "stream"] }
hyper-rustls = { version = "0.24", optional = true }
http = "1.0"
hyper = { version = "1", features = ["client", "http1"] }
hyper-rustls = { version = "0.26", optional = true }
hyper-util = { version = "0.1.2", features = ["http1", "client-legacy", "tokio"] }
http-body-util = "0.1.0"
log = "0.4"
pin-project-lite = "0.2.8"
num = { version = "0.4", optional = true }
rand = { version = "0.8", optional = true }
rustls = { version = "0.21", optional = true, features = ["dangerous_configuration"] }
rustls-native-certs = { version = "0.6.0", optional = true }
rustls-pemfile = { version = "1.0", optional = true }
rustls = { version = "0.22", optional = true, features = ["ring"] }
rustls-native-certs = { version = "0.7.0", optional = true }
rustls-pemfile = { version = "2.0", optional = true }
rustls-pki-types = { version = "1.1", optional = true }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
serde_repr = "0.1.6"
serde_urlencoded = "0.7"
tokio = { version = "1.7", features = ["time", "net"] }
tokio = { version = "1.35", features = ["time", "net", "io-util"] }
tonic = { version = "0.10", optional = true }
tower = { version = "0.4", optional = true }
thiserror = "1.0"
time = { version = "0.3", features = ["formatting", "parsing"], optional = true }
tokio-stream = { version = "0.1", optional = true }
tokio-util = { version = "0.7", features = ["codec"] }
tower-service = { version = "0.3", optional = true }
url = "2.2"
webpki-roots = { version = "0.25.2", optional = true }
webpki = { package = "rustls-webpki", version = "0.101.4", optional = true }
webpki-roots = { version = "0.26", optional = true }

[dev-dependencies]
flate2 = "1.0"
tar = "0.4"
tokio = { version = "1.7", features = ["fs", "rt-multi-thread", "macros"] }
yup-hyper-mock = "6.0.0"
yup-hyper-mock = { version = "8.0.0" }

[target.'cfg(unix)'.dependencies]
hyperlocal = { version = "0.8.0" }
hyperlocal = { git = "https://github.com/softprops/hyperlocal", rev = "34dc8579d74f96b68ddbd55582c76019ae18cfdc", version = "0.9.0-alpha" }

[target.'cfg(unix)'.dev-dependencies]
termion = "2.0"

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3.9", features = ["winerror"] }
tower-service = { version = "0.3" }

[package.metadata.docs.rs]
features = ["ssl"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ encouraged.

### Version

The [Docker API](https://docs.docker.com/engine/api/v1.43/) used by Bollard is using the latest
`1.43` documentation schema published by the [moby](https://github.com/moby/moby) project to
The [Docker API](https://docs.docker.com/engine/api/v1.44/) used by Bollard is using the latest
`1.44` documentation schema published by the [moby](https://github.com/moby/moby) project to
generate its serialization interface.

This library also supports [version
Expand Down
6 changes: 2 additions & 4 deletions codegen/proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "bollard-buildkit-proto"
description = "Protobuf definitions to interact with buildkit using Bollard"
version = "0.2.0"
version = "0.2.1"
authors = [ "Bollard contributors" ]
license = "Apache-2.0"
edition = "2021"

[features]
build = ["tonic-build", "indexmap"]
build = ["tonic-build"]

[[bin]]
name = "gen"
Expand All @@ -18,5 +18,3 @@ tonic = { version = "0.10" }
prost = { version = "0.12" }
prost-types = "0.12"
tonic-build = { version = "0.10", optional = true }
# bug: https://github.com/bluss/indexmap/issues/151#issuecomment-716691744
indexmap = { version = "2.0.0", features = ["std"], optional = true }
1 change: 1 addition & 0 deletions codegen/proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub mod google {
pub use prost_types as protobuf;
}

#[allow(clippy::all)]
pub mod pb {
include!("generated/pb.rs");
}
Expand Down
4 changes: 2 additions & 2 deletions codegen/swagger/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bollard-stubs"
version = "1.43.0-rc.2"
version = "1.44.0-rc.1"
authors = [ "Bollard contributors" ]
description = "Stubs used for the Bollard rust async Docker client API"
license = "Apache-2.0"
Expand All @@ -11,7 +11,7 @@ buildkit = ["base64", "bytes", "bollard-buildkit-proto", "prost"]

[dependencies]
base64 = { version = "0.21", optional = true }
bollard-buildkit-proto = { path = "../proto", version = "=0.2.0", optional = true }
bollard-buildkit-proto = { path = "../proto", version = "=0.2.1", optional = true }
bytes = { version = "1", optional = true }
chrono = { version = "0.4", default-features = false, features = ["std", "clock", "serde"], optional = true }
serde = { version = "1.0", features = ["derive"] }
Expand Down
6 changes: 3 additions & 3 deletions codegen/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ To see how to make this your own, look here:

[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)

- API version: 1.43.0-rc.2
- Code generation suffix: 1.43.0-rc.2
- Build date: 2023-09-15T16:02:09.609+01:00
- API version: 1.44.0-rc.1
- Code generation suffix: 1.44.0-rc.1
- Build date: 2024-01-24T09:26:30.020Z

This autogenerated project defines an API crate `bollard-stubs` which contains:
* Data types representing the underlying data model.
Expand Down
8 changes: 4 additions & 4 deletions codegen/swagger/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>bollard</groupId>
<artifactId>bollard-codegen</artifactId>
<version>0.1.4-SNAPSHOT</version>
<version>0.1.5-SNAPSHOT</version>
<name>bollard</name>

<!-- build with: mvn clean compiler:compile generate-resources -->
Expand All @@ -19,15 +19,15 @@
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>https://raw.githubusercontent.com/moby/moby/v24.0.0/docs/api/v1.43.yaml</inputSpec>
<inputSpec>https://raw.githubusercontent.com/moby/moby/v25.0.0/docs/api/v1.44.yaml</inputSpec>
<language>bollard.BollardCodegen</language>
<output>${project.basedir}</output>
<generateApis>true</generateApis>
<templateDirectory>${project.basedir}/src/main/resources/bollard</templateDirectory>
<supportingFilesToGenerate>models.rs,lib.rs,Cargo.toml,config,README.md</supportingFilesToGenerate>
<configOptions>
<packageName>bollard-stubs</packageName>
<packageVersion>1.43.0-rc.2</packageVersion>
<packageVersion>1.44.0-rc.1</packageVersion>
</configOptions>
</configuration>
</execution>
Expand All @@ -36,7 +36,7 @@
<dependency>
<groupId>bollard</groupId>
<artifactId>bollard-codegen</artifactId>
<version>0.1.4-SNAPSHOT</version>
<version>0.1.5-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion codegen/swagger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::io::Error;
#[allow(unused_imports)]
use std::collections::HashMap;

pub const BASE_PATH: &str = "/v1.43";
pub const BASE_PATH: &str = "/v1.44";

pub mod models;

Expand Down
2 changes: 1 addition & 1 deletion codegen/swagger/src/main/resources/bollard/Cargo.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildkit = ["base64", "bytes", "bollard-buildkit-proto", "prost"]

[dependencies]
base64 = { version = "0.21", optional = true }
bollard-buildkit-proto = { path = "../proto", version = "=0.2.0", optional = true }
bollard-buildkit-proto = { path = "../proto", version = "=0.2.1", optional = true }
bytes = { version = "1", optional = true }
chrono = { version = "0.4", default-features = false, features = ["std", "clock", "serde"], optional = true }
serde = { version = "1.0", features = ["derive"] }
Expand Down
3 changes: 2 additions & 1 deletion codegen/swagger/src/main/resources/bollard/models.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ fn deserialize_buildinfo_aux<'de, D: Deserializer<'de>>(
d: D,
) -> Result<crate::moby::buildkit::v1::StatusResponse, D::Error> {
let aux: String = serde::Deserialize::deserialize(d)?;
let raw = base64::decode(&aux).map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?;
let raw = base64::Engine::decode(&base64::engine::general_purpose::STANDARD, &aux)
.map_err(|e| serde::de::Error::custom(format!("{:?}", e)))?;
let buf = bytes::BytesMut::from(&raw[..]);

let res = crate::moby::buildkit::v1::StatusResponse::decode(buf)
Expand Down
Loading