@@ -104,6 +104,8 @@ export async function ensureDockerInjectionVolumeExists(
104
104
if ( existingVolume && ! isCertOutdated ) return ; // We're all good!
105
105
106
106
try {
107
+ const startTime = Date . now ( ) ;
108
+
107
109
// Clean up any leftover setup components that are hanging around (since they might
108
110
// conflict with these next steps):
109
111
await cleanupDataInjectionTools ( docker ) ;
@@ -138,21 +140,30 @@ export async function ensureDockerInjectionVolumeExists(
138
140
}
139
141
} ) ;
140
142
143
+ const blankContainerSetupTime = Date . now ( ) - startTime ;
144
+ let overrideStreamTime : number | undefined ;
145
+
141
146
// Then we use the container to write to the volume, without ever starting it:
142
147
const volumeStream = TarStream . pack ( ) ;
143
148
// We write the CA cert, read-only:
144
149
volumeStream . entry ( { name : 'ca.pem' , mode : parseInt ( '444' , 8 ) } , certContent ) ;
145
150
// And all the override filesL
146
151
const packOverridesPromise = packOverrideFiles ( volumeStream , '/overrides' )
147
- . then ( ( ) => volumeStream . finalize ( ) ) ;
152
+ . then ( ( ) => {
153
+ volumeStream . finalize ( ) ;
154
+ overrideStreamTime = Date . now ( ) - startTime ;
155
+ } ) ;
148
156
149
157
const writeVolumePromise = blankContainer . putArchive (
150
158
volumeStream ,
151
159
{ path : '/data-volume/' }
152
160
) ;
153
161
154
162
await Promise . all ( [ packOverridesPromise , writeVolumePromise ] ) ;
155
- console . log ( 'Created Docker injection volume' ) ;
163
+ const volumeCompleteTime = Date . now ( ) - startTime ;
164
+ console . log ( `Created Docker injection volume (took ${
165
+ volumeCompleteTime
166
+ } ms: ${ blankContainerSetupTime } ms for setup & ${ overrideStreamTime ! } ms to pack)`) ;
156
167
157
168
// After success, we cleanup the tools (blank image & containers etc) and all old HTTP
158
169
// Toolkit volumes, i.e. all matching volumes _except_ the current one.
0 commit comments