You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for specific items in the spec is very poor it makes using opctl much harder. An example I can give is files parameter. An example of using it is here: https://opctl.io/docs/training/inputs-outputs
but... I couldn't find any example where I can copy a file to a container. The example above shows how we can put text into it but not copy a file inside. Here's what I tried but nothing succeeded
The documentation definitely needs work, particularly around tutorials and recipes.
In this case, here's an example op that passes a file in:
name: exampledescription: an example opinputs:
example-input:
file:
default: ./optestrun:
container:
image: { ref: 'alpine' }cmd: ['echo', $(example-input)]
I suggest making a test directory, adding a .opspec directory to the test directory, adding and example directory, and adding the above op as op.yml in the example directory.
mkdir opctl-test
mkdir opctl-test/.opspec
mkdir opctl-test/.opspec/example
touch opctl-test/.opspec/example/op.yml
# paste the example op into ^ this fileecho hello world > optest
opctl run example
It'll load the file and the op will echo "hello world" to the command line.
If you want an op to have access to a file as a thing, then I suggest passing in the directory containing the file:
name: exampledescription: an example opinputs:
example-input:
dir:
default: ./run:
container:
image: { ref: 'alpine' }cmd: ["ls", "/example-input"]dirs:
/example-input: $(example-input)
if you use the directory created for the previous example, then create a new op (example-directory, for instance), running opctl run example-directory should produce the optest file that was created earlier
馃摎 Documentation
The documentation for specific items in the spec is very poor it makes using opctl much harder. An example I can give is
files
parameter. An example of using it is here: https://opctl.io/docs/training/inputs-outputsbut... I couldn't find any example where I can copy a file to a container. The example above shows how we can put text into it but not copy a file inside. Here's what I tried but nothing succeeded
etc
The text was updated successfully, but these errors were encountered: