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

Give Image::pull, Image::build and Image::import chunked json a type #262

Closed
wants to merge 3 commits into from
Closed

Give Image::pull, Image::build and Image::import chunked json a type #262

wants to merge 3 commits into from

Conversation

vv9k
Copy link
Contributor

@vv9k vv9k commented Feb 8, 2021

What did you implement:

Added a type ImageBuildChunk for stream chunks when using Image::pull and Image::build.

Closes: #144

How did you verify your change:

Tested locally and got expected results:

Image::pull

❯ cargo run --example imagepull -- centos:7
   Compiling shiplift v0.7.0 (/home/wojtek/dev/shiplift)
    Finished dev [unoptimized + debuginfo] target(s) in 5.68s
     Running `target/debug/examples/imagepull 'centos:7'`
PullStatus { status: "Pulling from library/centos", id: Some("7"), progress: None, progress_detail: None }
PullStatus { status: "Pulling fs layer", id: Some("2d473b07cdd5"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[>                                                  ]  535.8kB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(535762), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[=====>                                             ]  8.035MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(8034738), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[==========>                                        ]  15.55MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(15550898), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[==============>                                    ]  22.52MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(22518194), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[===================>                               ]  28.94MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(28944818), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[=======================>                           ]  36.42MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(36424114), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[============================>                      ]  43.91MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(43907506), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[=================================>                 ]   51.4MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(51399090), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[======================================>            ]  58.88MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(58878386), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[===========================================>       ]  66.91MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(66914738), total: Some(76097157) }) }
PullStatus { status: "Downloading", id: Some("2d473b07cdd5"), progress: Some("[================================================>  ]  74.41MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(74406322), total: Some(76097157) }) }
PullStatus { status: "Verifying Checksum", id: Some("2d473b07cdd5"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Download complete", id: Some("2d473b07cdd5"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[>                                                  ]  557.1kB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(557056), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[=====>                                             ]  8.356MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(8355840), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[==========>                                        ]   15.6MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(15597568), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[=============>                                     ]  20.61MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(20611072), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[================>                                  ]  25.62MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(25624576), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[====================>                              ]  31.75MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(31752192), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[==========================>                        ]  40.11MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(40108032), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[==============================>                    ]  46.79MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(46792704), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[================================>                  ]  49.58MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(49577984), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[===================================>               ]  53.48MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(53477376), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[======================================>            ]  57.93MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(57933824), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[==========================================>        ]  64.06MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(64061440), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[============================================>      ]  67.96MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(67960832), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[=============================================>     ]  69.63MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(69632000), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[=================================================> ]  74.65MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(74645504), total: Some(76097157) }) }
PullStatus { status: "Extracting", id: Some("2d473b07cdd5"), progress: Some("[==================================================>]   76.1MB/76.1MB"), progress_detail: Some(ProgressDetail { current: Some(76097157), total: Some(76097157) }) }
PullStatus { status: "Pull complete", id: Some("2d473b07cdd5"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Digest: sha256:0f4ec88e21daf75124b8a9e5ca03c37a5e937e0e108a255d890492430789b60e", id: None, progress: None, progress_detail: None }
PullStatus { status: "Status: Downloaded newer image for centos:7", id: None, progress: None, progress_detail: None }

Image::Build

❯ cargo run --example imagebuild -- test
   Compiling shiplift v0.7.0 (/home/wojtek/dev/shiplift)
    Finished dev [unoptimized + debuginfo] target(s) in 1.99s
     Running `target/debug/examples/imagebuild test`
Update { stream: "Step 1/2 : FROM debian:9" }
Update { stream: "\n" }
PullStatus { status: "Pulling from library/debian", id: Some("9"), progress: None, progress_detail: None }
PullStatus { status: "Pulling fs layer", id: Some("1e987daa2432"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Downloading", id: Some("1e987daa2432"), progress: Some("[>                                                  ]  461.3kB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(461277), total: Some(45379885) }) }
PullStatus { status: "Downloading", id: Some("1e987daa2432"), progress: Some("[=========>                                         ]  8.285MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(8284637), total: Some(45379885) }) }
PullStatus { status: "Downloading", id: Some("1e987daa2432"), progress: Some("[==================>                                ]  16.57MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(16566749), total: Some(45379885) }) }
PullStatus { status: "Downloading", id: Some("1e987daa2432"), progress: Some("[===========================>                       ]  24.84MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(24844765), total: Some(45379885) }) }
PullStatus { status: "Downloading", id: Some("1e987daa2432"), progress: Some("[===================================>               ]  32.21MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(32209373), total: Some(45379885) }) }
PullStatus { status: "Downloading", id: Some("1e987daa2432"), progress: Some("[============================================>      ]   40.5MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(40499677), total: Some(45379885) }) }
PullStatus { status: "Verifying Checksum", id: Some("1e987daa2432"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Download complete", id: Some("1e987daa2432"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[>                                                  ]  458.8kB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(458752), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[=========>                                         ]  8.716MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(8716288), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[=================>                                 ]  16.06MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(16056320), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[=======================>                           ]  21.56MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(21561344), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[==================================>                ]   31.2MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(31195136), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[========================================>          ]   36.7MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(36700160), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[=============================================>     ]  41.75MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(41746432), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[=================================================> ]   44.5MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(44498944), total: Some(45379885) }) }
PullStatus { status: "Extracting", id: Some("1e987daa2432"), progress: Some("[==================================================>]  45.38MB/45.38MB"), progress_detail: Some(ProgressDetail { current: Some(45379885), total: Some(45379885) }) }
PullStatus { status: "Pull complete", id: Some("1e987daa2432"), progress: None, progress_detail: Some(ProgressDetail { current: None, total: None }) }
PullStatus { status: "Digest: sha256:d0b7b71db141cedc48e1c2807d12b199ffd7ffe75baf272a34c37480dc2159d1", id: None, progress: None, progress_detail: None }
PullStatus { status: "Status: Downloaded newer image for debian:9", id: None, progress: None, progress_detail: None }
Update { stream: " ---> f00be68857e6\n" }
Update { stream: "Step 2/2 : CMD [\"/bin/bash\", \"-c\", \"sleep infinity\"]" }
Update { stream: "\n" }
Update { stream: " ---> Running in 30e8c21f6f5f\n" }
Update { stream: "Removing intermediate container 30e8c21f6f5f\n" }
Update { stream: " ---> 32030c6eaf3d\n" }
Digest { aux: Aux { id: "sha256:32030c6eaf3d9ce5f6fe519b99a48c778e4e27a6c9ea97bcc45e05c3bdcf381b" } }
Update { stream: "Successfully built 32030c6eaf3d\n" }
Update { stream: "Successfully tagged shiplift_test:latest\n" }
 cargo run --example imagebuild -- test_fail
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/examples/imagebuild test_fail`
Update { stream: "Step 1/3 : FROM debian" }
Update { stream: "\n" }
Update { stream: " ---> 5890f8ba95f6\n" }
Update { stream: "Step 2/3 : ENTRYPOINT [\"slee\"]" }
Update { stream: "\n" }
Update { stream: " ---> Using cache\n" }
Update { stream: " ---> 78542825bfe0\n" }
Update { stream: "Step 3/3 : RUN \"slee 123\"" }
Update { stream: "\n" }
Update { stream: " ---> Running in c115e8e6be95\n" }
Update { stream: "\u{1b}[91m/bin/sh: 1: slee 123: not found\n\u{1b}[0m" }
Error { error: "The command \'/bin/sh -c \"slee 123\"\' returned a non-zero code: 127", error_detail: ErrorDetail { message: "The command \'/bin/sh -c \"slee 123\"\' returned a non-zero code: 127" } }

What (if anything) would need to be called out in the CHANGELOG for the next release:

I updated the CHANGELOG accordingly.

@vv9k vv9k changed the title Image pull ty Give Image::pull chunked json a type Feb 8, 2021
@vv9k vv9k changed the title Give Image::pull chunked json a type Give Image::pull, Image::build and Image::import chunked json a type Feb 8, 2021
Copy link
Contributor

@elihunter173 elihunter173 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the changes a lot! Though I wish I could find the documentation for these chunks in the docker API 🙃

src/rep.rs Outdated Show resolved Hide resolved
src/rep.rs Outdated
Comment on lines 35 to 48
#[derive(Serialize, Deserialize, Debug)]
pub struct ImagePullChunk {
status: String,
id: Option<String>,
progress: Option<String>,
#[serde(rename = "progressDetail")]
progress_detail: Option<ProgressDetail>,
}

#[derive(Serialize, Deserialize, Debug)]
pub struct ProgressDetail {
current: Option<u64>,
total: Option<u64>,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this would be better as an enum instead of a struct with optional fields, but I can't think of a good way to slice it...

Copy link
Contributor Author

@vv9k vv9k Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to split it up into an enum as all fields can be present at the same time or 3 fields, or just 1

@vv9k
Copy link
Contributor Author

vv9k commented Feb 11, 2021

I like the changes a lot! Though I wish I could find the documentation for these chunks in the docker API upside_down_face

Yes, I wish it was documented somehow as well. Only way to find out what is available is to test every possibility and even then it's sometimes hard to fake an error or some random condition that would return a chunk not properly handled.

As a side note, I also find it annoying that most fields in API reference, although declared as not nullable are actually nullable and one has to determine by doing lots of tests...

src/rep.rs Outdated
#[derive(Serialize, Deserialize, Debug)]
#[serde(untagged)]
/// Represents a response chunk from Docker api when building, pulling or importing an image.
pub enum ImageBuildChunk {
Copy link
Contributor Author

@vv9k vv9k Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also wondering if this is the best name. Maybe ImageStreamChunk or something else?

@vv9k
Copy link
Contributor Author

vv9k commented Feb 12, 2021

Ok, so perhaps not in api reference but the struct JSONMessage in dockers source code seems to be what we are after

https://github.com/moby/moby/blob/c9bbc68e75f224c4490ff6e3121be50a612edc22/pkg/jsonmessage/jsonmessage.go#L138

@vv9k
Copy link
Contributor Author

vv9k commented Feb 12, 2021

I'm wondering how to handle this one. Should I create JsonMessage and JsonProgress structs with all the fields? Current way of parsing it as an enum makes it much easier to handle for end user but it's unsure which fields will be used in the response chunk.

EDIT:

Current way definitely feels much more readable compared to this:

❯ cargo run --example imagebuild test
   Compiling shiplift v0.7.0 (/home/wojtek/dev/shiplift)
warning: unused import: `ImageBuildChunk`
  --> src/lib.rs:41:56
   |
41 |         ExecDetails, Exit, History, Image as ImageRep, ImageBuildChunk, ImageDetails, Info,
   |                                                        ^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 4.81s
     Running `target/debug/examples/imagebuild test`
JsonMessage { stream: Some("Step 1/2 : FROM rust"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some("\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Pulling from library/rust"), progress: None, id: Some("latest"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Already exists"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("0ecb575e629c"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Already exists"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("7467d1831b69"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Already exists"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("feab2c490a3c"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Already exists"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("f15a0f46f8c3"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Already exists"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("937782447ff6"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Pulling fs layer"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(535805), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(4823517), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(12286429), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(20302301), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(27802077), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(35285469), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(42777053), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(50797021), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(58309085), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(66345437), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(74385885), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(81893853), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(89393629), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(95820253), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(103864797), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(111368669), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(119409117), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(127457757), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(134961629), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(143526365), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Downloading"), progress: Some(JsonProgress { current: Some(151591389), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Verifying Checksum"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Download complete"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(557056), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(10584064), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(17268736), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(21168128), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(28409856), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(37322752), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(44007424), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(48463872), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(53477376), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(60162048), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(67960832), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(75759616), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(81330176), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(85786624), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(90243072), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(95256576), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(101941248), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(107511808), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(114196480), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(119209984), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(123666432), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(129794048), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(134807552), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(139264000), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(144834560), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(152633344), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Extracting"), progress: Some(JsonProgress { current: Some(153584608), total: Some(153584608), start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Pull complete"), progress: Some(JsonProgress { current: None, total: None, start: None, hide_counts: None, units: None, win_size: None }), id: Some("52af7262c10a"), from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Digest: sha256:91a70ac97ddb82978060db53b994f5edac1253f33dd417551810a4feac0b2245"), progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: Some("Status: Downloaded newer image for rust:latest"), progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some(" ---> a1d85bc5818f\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some("Step 2/2 : ENV \"test\" \"123\""), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some("\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some(" ---> Running in 3f45d316fcbd\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some("Removing intermediate container 3f45d316fcbd\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some(" ---> fac75b2a239c\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: None, status: None, progress: None, id: None, from: None, time: None, error: None, aux: Some(Object({"ID": String("sha256:fac75b2a239cda1349693e00c4872fd3f14a2a1309ed072bb0cce0f118ae2767")})) }
JsonMessage { stream: Some("Successfully built fac75b2a239c\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }
JsonMessage { stream: Some("Successfully tagged shiplift_test:latest\n"), status: None, progress: None, id: None, from: None, time: None, error: None, aux: None }

@vv9k
Copy link
Contributor Author

vv9k commented Mar 12, 2021

So I rebased the PR, and brought back ImageBuildChunk, I think it seems like the best way to handle this chunks.

Copy link
Collaborator

@matthiasbeyer matthiasbeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! I guess you need to rebase here as well. 👍

@vv9k vv9k closed this Jun 29, 2021
@matthiasbeyer matthiasbeyer mentioned this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

give image pull chunked json a proper type
3 participants