Closed royragsdale closed 4 years ago
Turns out the tar is created but seemingly removed prior to when the solver can use it.
Seems that it is actually that the tar name is incorrect:
cmgr: [ERROR: failed to build solver image: error during connect: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.25/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=cmgr%2Fexamples%2Fcustom-socat%2Fsolver%3A2&ulimits=null": open /home/r/code/cmgr/6fd0fa68915bdd38c63df70038c735ee360ccad95e022f1da4b79f0051c1c041.tar.gz: no such file or directory]
error (cmgr/examples/custom-socat): solver failed: error during connect: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.25/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=cmgr%2Fexamples%2Fcustom-socat%2Fsolver%3A2&ulimits=null": open /home/r/code/cmgr/6fd0fa68915bdd38c63df70038c735ee360ccad95e022f1da4b79f0051c1c041.tar.gz: no such file or directory
cmgr: [DEBUG: stopping instance 1]
cmgr: [DEBUG: destroying build 2]
cmgr: [WARN: Removing: 20e05690710b7a965eefa1d2cc53b060b9780031e1eebe578bd1ee474da62524.tar.gz]
docker.go: artifactsFileName := fmt.Sprintf("%s.tar.gz", image.DockerId)
v.s.
solver_framework.go: artifactsPath := filepath.Join(m.artifactsDir, fmt.Sprintf("%s.tar.gz", sumStr))
r@x: ~/code/cmgr $ ./bin/cmgr test examples/custom/
cmgr: [WARN: extracting to: 20e05690710b7a965eefa1d2cc53b060b9780031e1eebe578bd1ee474da62524.tar.gz]
cmgr: [WARN: artifacts: /home/r/code/cmgr/6fd0fa68915bdd38c63df70038c735ee360ccad95e022f1da4b79f0051c1c041.tar.gz]
cmgr: [ERROR: failed to build solver image: error during connect: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.25/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=cmgr%2Fexamples%2Fcustom-socat%2Fsolver%3A1&ulimits=null": open /home/r/code/cmgr/6fd0fa68915bdd38c63df70038c735ee360ccad95e022f1da4b79f0051c1c041.tar.gz: no such file or directory]
error (cmgr/examples/custom-socat): solver failed: error during connect: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.25/build?buildargs=null&cachefrom=null&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=&labels=null&memory=0&memswap=0&networkmode=&rm=0&shmsize=0&t=cmgr%2Fexamples%2Fcustom-socat%2Fsolver%3A1&ulimits=null": open /home/r/code/cmgr/6fd0fa68915bdd38c63df70038c735ee360ccad95e022f1da4b79f0051c1c041.tar.gz: no such file or directory
cmgr: [WARN: Removing: 20e05690710b7a965eefa1d2cc53b060b9780031e1eebe578bd1ee474da62524.tar.gz]
yeah root cause ties back to changing the format of the seed:
cmgr/solver_framework.go
- sum := sha256.Sum256([]byte(fmt.Sprintf("%s:%s:%x", meta.Challenge, meta.Format, meta.Seed)))
+ sum := sha256.Sum256([]byte(fmt.Sprintf("%s:%s:%d", meta.Challenge, meta.Format, meta.Seed)))
%x
to %d
closing since was never an issue on master.
only an issue on #9. Since resolved.
As a meta point though, the construction of the hash/id/artifact path is scattered about a few places and might benefit from a helper function/struct method
When running
cmgr test
on a challenge with artifacts they fail to get written to disk prior to the solver image starting. When running with--no-solve
the tar is properly written to disk.relevant line:
full log: