Add Web ARChive example (warc)#105
Conversation
|
Thanks for giving this a shot Gerhard! It'll be extremely helpful to have more validation that the workflow implementation is moving in the right direction. Couple of assorted pointers (after pulling my latest changes in #95)
I realize much (or most) of this is still very clunky if you don't follow the exact right pattern. Please let me know what else comes up and feel free to let me know what's missing, frustrating, unintuitive, etc. and we can figure out how to address it. |
|
@sipsma @aluzzardi @shykes Is #95 still the best branch to base my PR onto? I am just about to start adding v2 Go workflow code and I'm wondering which is the best branch to use as my starting point. Thanks! |
Yes it still is, been merging commits from it into main (but also adding more as demov2 iteration continues). I am actively working on getting it merged though and will let you know once you can switch back to being based on main. |
|
@gerhard #95 has been merged finally, thank you for dealing with the hassle as it got cleaned up and ready for main! There are some newly updated docs on creating projects with Go here: https://github.com/dagger/cloak/blob/main/docs/writing_extensions_go.md One nice improvement is that my previous comment is now outdated: once you've updated cloak.yaml to the new format described in that doc you can just run There's still plenty of rough edges of course though so let me know what you run into. |
All the context is in the README.md Signed-off-by: Gerhard Lazu <gerhard@dagger.io>
Squash Signed-off-by: Gerhard Lazu <gerhard@dagger.io>
Tanguy was missing a workdir example, which this contains. Signed-off-by: Gerhard Lazu <gerhard@dagger.io>
While it doesn't fully work, it's another good step in the right direction. Signed-off-by: Gerhard Lazu <gerhard@dagger.io>
❌ Deploy Preview for cloak-docs failed.
|
| Args: []string{"./run.sh"}, | ||
| Workdir: "/mnt", | ||
| Mounts: []core.MountInput{ | ||
| core.MountInput{Fs: workdirResp.Host.Workdir.Read.ID, Path: "/mnt/"}, |
There was a problem hiding this comment.
I think there is a bug in cloak right now where we aren't cleaning the paths, so because you have /mnt/ here (trailing /) and /mnt (no trailing) on line 43, cloak can't find your mount.
I'll go fix (can't imagine it's more than a 1 line change) but you can also change this to be /mnt in the meantime.
| // Start from Alpine | ||
| image, err := core.Image(ctx, "alpine:3.15") | ||
| if err != nil { | ||
| return err | ||
| } | ||
|
|
||
| fs := &image.Core.Image | ||
|
|
||
| // Install deps & declare workdir | ||
| deps, err := core.Exec(ctx, fs.ID, core.ExecInput{ | ||
| Args: []string{"apk", "add", "-U", "--no-cache", "wget", "bash"}, | ||
| Workdir: "/mnt", | ||
| }) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to install: %s", err) | ||
| } | ||
| fs = deps.Core.Filesystem.Exec.Fs |
There was a problem hiding this comment.
If you want, you can use the alpine extension to do this too. Can just add a git dep (example here)
|
Found that, just leaving it here: https://github.com/richardlehane/webarchive |
Technically, it should not git commit & push, but I'm trying to figure out if I can write it in a single flow, before I start splitting it up. Signed-off-by: Gerhard Lazu <gerhard@dagger.io>
|
This repository has moved to https://github.com/dagger/dagger/tree/cloak Please re-open this PR in From the cloak repository:
NOTE: there might be some commits not authored by you. Delete them.
Make sure you have the GitHub CLI installed (on macOS:
|
|
It's OK to close this. All the learnings are there, will start fresh from a new baseline & just link to this one instead. |
Uses Cloak's Go SDK.
warcfile