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

multidim interop: Debug sizes and execution times #230

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
13 changes: 13 additions & 0 deletions .github/actions/run-interop-ping-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ runs:
exit 1
fi

- name: Print implementation images
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
run: head impl/*/*/*image.json
shell: bash
- name: Print the image sizes
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
run: docker image ls
shell: bash
- name: Print Docker disk usage
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
run: docker system df
shell: bash

- name: Push the image cache
if: env.PUSH_CACHE == 'true'
working-directory: ${{ steps.find-workdir.outputs.WORK_DIR }}
Expand Down
7 changes: 6 additions & 1 deletion multidim-interop/helpers/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ switch (modeStr) {
const dockerLoadedMsg = child_process.execSync(`curl https://s3.amazonaws.com/${AWS_BUCKET}/imageCache/${cacheKey}-${arch}.tar.gz | docker image load`).toString();
const loadedImageId = dockerLoadedMsg.match(/Loaded image( ID)?: (.*)/)[2];
if (loadedImageId) {
console.log(`Cache hit for ${loadedImageId}`);
let imageSize = "unknown"
try {
const imageSizeBytes = child_process.execSync(`docker image inspect ${loadedImageId} -f "{.Size}"`).toString().trim();
imageSize = imageSizeBytes
} catch { }
console.log(`Cache hit for ${loadedImageId}. Size ${imageSize}.`);
fs.writeFileSync(path.join(implFolder, 'image.json'), JSON.stringify({ imageID: loadedImageId }) + "\n");
cacheHit = true
}
Expand Down
14 changes: 13 additions & 1 deletion multidim-interop/src/compose-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type RunOpts = {
export type RunFailure = any

export async function run(namespace: string, compose: ComposeSpecification, opts: RunOpts): Promise<RunFailure | null> {
const start = Date.now()
// sanitize namespace
const sanitizedNamespace = namespace.replace(/[^a-zA-Z0-9]/g, "-")
const dir = path.join(tmpdir(), "compose-runner", sanitizedNamespace)
Expand Down Expand Up @@ -54,7 +55,18 @@ export async function run(namespace: string, compose: ComposeSpecification, opts
clearTimeout(timeoutId)
try {
const testResultsParsed = dialerTimings(dialerStdout(stdout))
console.log("Finished:", namespace, testResultsParsed)
const elapsed = (Date.now() - start) / 1000
console.log(`Finished in ${elapsed}s:`, namespace, testResultsParsed)
if (elapsed > 30) {
// Really slow, why?
console.log("Slow interop test. Debugging info:")
console.log("stdout:")
console.log(stdout)
console.log("")
console.log("stderr:")
console.log(stderr)
console.log("")
}
} catch (e) {
console.log("Failed to parse test results.")
console.log("stdout:")
Expand Down