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

binary file via init #595

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

willcl-ark
Copy link
Contributor

probably should launch a commander like this too really...

@pinheadmz
Copy link
Contributor

Yes nice approach. A solid step to close #383 as well.

Dunno if we need to keep binaries and scenarios separate for sake of Warnet status or "missions"

don't forget to run test in ci by adding to test.yml !

@pinheadmz
Copy link
Contributor

Also what if user wants to run multiple commands on a special binary? Like, deploy an application along with a script that runs it, or any case with multiple files ?

@willcl-ark
Copy link
Contributor Author

don't forget to run test in ci by adding to test.yml !

whoops! thanks

Also what if user wants to run multiple commands on a special binary? Like, deploy an application along with a script that runs it, or any case with multiple files ?

They will have to build that themselves. Prob easiest to just write a dockerfile at that stage?


options:
| name | type | required | default |
|-----------------|--------|------------|-----------|
| scenario_file | Path | yes | |
| additional_args | String | | |

### `warnet run-binary`
Run a file in warnet
Pass `-- --help` to get individual scenario help
Copy link
Contributor

Choose a reason for hiding this comment

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

-- --help is specific to Commander/test framework, might not apply to all binaries

@josibake
Copy link
Collaborator

BIG Concept ACK, light code review ack (haven't tested).

Really like the initContainers approach , as this gives us a ton of flexibility in the future without needing to continually re-write our python code. It also gives a single place to manage things like putting the files in the correct directory, set the write permissions (as you're currently doing), and more all in a self contained unit that cleans up after itself. This allows the resulting image to be clean and just focus on "running the thing." Also very happy to see we are not base64'ing files into etcd just to get them into a container. This should allow users to package arbitrarily large binaries without hitting configMap limits, or slowing down etcd.

@bdp-DrahtBot
Copy link
Collaborator

bdp-DrahtBot commented Sep 13, 2024

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

args:
- |
echo "Waiting for binary file..."
while [ ! -f /data/binary ]; do
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this wait was moved into the main container we wouldn't need the initContainer?

Is there another advantage to the init container?

Copy link
Contributor Author

@willcl-ark willcl-ark Sep 16, 2024

Choose a reason for hiding this comment

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

There is no other advantage, nice spot. This is just an artefact of me trying to migrate from configMap and, instead of taking two steps forward, only taking one.

Removed the init container in effe95d

@willcl-ark willcl-ark force-pushed the bin branch 2 times, most recently from 2ddb7fa to 9b7c30a Compare September 16, 2024 09:04
@m3dwards
Copy link
Collaborator

Ruff failure but otherwise looks good.

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.

5 participants