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

script to debug test images #35

Merged
merged 4 commits into from
Nov 30, 2023
Merged

script to debug test images #35

merged 4 commits into from
Nov 30, 2023

Conversation

turadg
Copy link
Member

@turadg turadg commented Nov 29, 2023

This provides a new script debugTestImage that works like the runTestImages except it:

  • takes exactly one matching proposal
  • enters with start_agd instead of the test runner (so the chain process persists)
  • provides instructions for starting a new shell to interact in the container
  • mounts the proposals dir so changes in the local filesystem appear in the container

It also sets SLOGFILE in start_agd so there's a log when running the container as a chain (vs as a build or test image)

@turadg turadg requested review from dckc and Chris-Hibbert November 29, 2023 19:15
Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

LGTM.

I gather @Chris-Hibbert has tested / used it.

@@ -151,7 +151,8 @@ WORKDIR /usr/src/upgrade-test-scripts
COPY --link ./upgrade-test-scripts/install_deps.sh /usr/src/upgrade-test-scripts/
RUN --mount=type=cache,target=/root/.yarn ./install_deps.sh ${proposalIdentifier}:${proposalName}

COPY --link --chmod=755 ./upgrade-test-scripts/run_test.sh /usr/src/upgrade-test-scripts/run_test.sh
# copy run_test for this entrypoing and start_agd for optional debugging
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# copy run_test for this entrypoing and start_agd for optional debugging
# copy run_test for this entrypoint and start_agd for optional debugging

COPY --link --chmod=755 ./upgrade-test-scripts/run_eval.sh /usr/src/upgrade-test-scripts/run_eval.sh
COPY --link --chmod=755 ./upgrade-test-scripts/run_eval.sh /usr/src/upgrade-test-scripts/
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious... is this just conciseness? or is there a difference in behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

just consistency with the other copies which copy multiple files (and therefore have to specify a dir target instead of filename)

README.md Outdated
## Contributing
## Debugging

To get the local files into the container, use a mount. E.g.
Copy link
Member

Choose a reason for hiding this comment

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

I think the terminology is...

Suggested change
To get the local files into the container, use a mount. E.g.
To get the local files into the container, use a volume. E.g.

or perhaps change "use a mount" to "mount a volume"

Copy link
Member Author

Choose a reason for hiding this comment

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

It's really not a "volume", but bind mount. I'll use the full term.

} as const;
const { values } = parseArgs({ options });

const proposal = readOneProposal(values.match!);
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious: what does that (values.match!) compile to?

Is this another case where we're outside a .ts dialect where the difference between .ts and .js is "erase the types"?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's elided in the JS. it just tells TS that the we're sure the value isn't undefined.

const proposal = readOneProposal(values.match!);

console.log(
// XXX Raph had a better way to get the container name than the jq below
Copy link
Member

Choose a reason for hiding this comment

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

The idiom I've seen in automation is to use the container id printed by docker run.
Then I suppose you could docker inspect it to get the name.

Copy link
Member Author

Choose a reason for hiding this comment

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

@turadg turadg enabled auto-merge November 29, 2023 23:27
@turadg turadg merged commit e8c43f8 into main Nov 30, 2023
1 check passed
@turadg turadg deleted the ta/debug-test branch November 30, 2023 00:16
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.

2 participants