Skip to content

Commit

Permalink
working towards distributed Docker version
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnTools committed Dec 12, 2024
1 parent a63bff2 commit de296f9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ COPY . .
RUN cd embedded/sim-dir && go mod tidy && go build -o /bin/sim sim.go exp.go

# remember to use "-v" to map in /tmp/extern
WORKDIR /tmp/extern
WORKDIR /pcesapps/embedded
4 changes: 2 additions & 2 deletions embedded/sim-dir/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ require (
github.com/iti/evt/evtm v0.1.4
github.com/iti/evt/vrtime v0.1.5
github.com/iti/mrnes v0.0.16
github.com/iti/pces v0.0.12
github.com/iti/pces v0.0.13
github.com/iti/rngstream v0.2.2
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
golang.org/x/exp v0.0.0-20241210194714-1829a127f884
)

require (
Expand Down
21 changes: 4 additions & 17 deletions embedded/sim-dir/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,16 @@ github.com/iti/evt/evtq v0.1.4 h1:cLkfhqiCRUSeiDVN/YN2ZC2L1mznL9n5o9CFKt/pwkc=
github.com/iti/evt/evtq v0.1.4/go.mod h1:85Zm3A+dgRd72YV8DS2VoNExUCt3Ckq2GqYnI4oqlBY=
github.com/iti/evt/vrtime v0.1.5 h1:5d2O3ZGb9OruBkBxZ1PzyXBlHkAUmW27jz9fUXHc6MI=
github.com/iti/evt/vrtime v0.1.5/go.mod h1:NtgQQ20CSeaLxWNsAROKuHtAdeXNZ86Wg6ox2l5LtrU=
<<<<<<< HEAD:beta/db/go.sum
github.com/iti/mrnes v0.0.13 h1:r+iqkgblIgjvLmgzIaW6oNzU3l7E5Eunu07v9fKxIk4=
github.com/iti/mrnes v0.0.13/go.mod h1:cFguMaOXLfIOljE+lKuTxXm4m6/N8Aml6YhObQ5NsnU=
github.com/iti/pces v0.0.11 h1:+/foFvEOi6r5sNaQdJWcxlHM7ZprWK4pWJlITc0VXLM=
github.com/iti/pces v0.0.11/go.mod h1:2mPmi47Z2qWjiHhI0C6+SkOiPSHNqjTahr7MBH/2XGU=
github.com/iti/rngstream v0.2.2 h1:9cfSikwWPW1Yie+RjdJ23uUuMryLu+Ou38/TChYLPZ8=
github.com/iti/rngstream v0.2.2/go.mod h1:sf9vdWtEjVW4dxOocgIqbivkNIrfcl10H8jEeeqFNnQ=
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6 h1:1wqE9dj9NpSm04INVsJhhEUzhuDVjbcyKH91sVyPATw=
golang.org/x/exp v0.0.0-20241004190924-225e2abe05e6/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
gonum.org/v1/gonum v0.15.0 h1:2lYxjRbTYyxkJxlhC+LvJIx3SsANPdRybu1tGj9/OrQ=
gonum.org/v1/gonum v0.15.0/go.mod h1:xzZVBJBtS+Mz4q0Yl2LJTk+OxOg4jiXZ7qBoM0uISGo=
=======
github.com/iti/mrnes v0.0.16 h1:TiyBzSFo4teG0EvKjbdOPHhvC6HywDmGmVRRtD06wkI=
github.com/iti/mrnes v0.0.16/go.mod h1:1P8kC384qaei5i84ZK42VYDrXmRLiYZHmx52yeLL37E=
github.com/iti/pces v0.0.12 h1:bggUNxGbC3DTgMyH8X/n0GyNvWSAYOVswn+erskAbqw=
github.com/iti/pces v0.0.12/go.mod h1:YvZkVcKJkgt7o4G1RLIoaqJ+JanofW6Kpyd0j0tvi9s=
github.com/iti/pces v0.0.13 h1:5WoM6X/rNH8YQS4uiwACT8euMLm/JokMyiFAbQdaWsw=
github.com/iti/pces v0.0.13/go.mod h1:YvZkVcKJkgt7o4G1RLIoaqJ+JanofW6Kpyd0j0tvi9s=
github.com/iti/rngstream v0.2.2 h1:9cfSikwWPW1Yie+RjdJ23uUuMryLu+Ou38/TChYLPZ8=
github.com/iti/rngstream v0.2.2/go.mod h1:sf9vdWtEjVW4dxOocgIqbivkNIrfcl10H8jEeeqFNnQ=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU=
golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0=
gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o=
>>>>>>> chgflow:embedded/sim-dir/go.sum
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
28 changes: 14 additions & 14 deletions embedded/sim-dir/sim.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ func main() {
}

// if container is set change inputDir and outputDir
// to be /tmp/external/input and /tmp/external/output
// to be /tmp/extern/input and /tmp/extern/output
if container {
// create /tmp/external if needed
inputDir = "/tmp/external/input"
outputDir = "/tmp/external/output"
// create /tmp/extern if needed
inputDir = "/tmp/extern/input"
outputDir = "/tmp/extern/output"

if _, err := os.Stat("/tmp/external"); os.IsNotExist(err) {
err := os.Mkdir("/tmp/external", 0755)
if _, err := os.Stat("/tmp/extern"); os.IsNotExist(err) {
err := os.Mkdir("/tmp/extern", 0755)
if err != nil {
panic(errors.New("unable to create /tmp/external"))
panic(errors.New("unable to create /tmp/extern"))
}
os.Mkdir("/tmp/external/input", 0755)
os.Mkdir("/tmp/external/output", 0755)
os.Mkdir("/tmp/extern/input", 0755)
os.Mkdir("/tmp/extern/output", 0755)
}
if _, err := os.Stat("/tmp/external/output"); os.IsNotExist(err) {
err := os.Mkdir("/tmp/external", 0755)
if _, err := os.Stat("/tmp/extern/output"); os.IsNotExist(err) {
err := os.Mkdir("/tmp/extern", 0755)
if err != nil {
panic(errors.New("unable to create /tmp/external/output"))
panic(errors.New("unable to create /tmp/extern/output"))
}

}
Expand Down Expand Up @@ -137,7 +137,7 @@ func main() {
traceFile = filepath.Join(outputDir, traceFile)
} else {
baseFile := filepath.Base(traceFile)
traceFile = filepath.Join("/tmp/external/output", baseFile)
traceFile = filepath.Join("/tmp/extern/output", baseFile)
}
outputFiles = append(outputFiles, traceFile)
}
Expand All @@ -148,7 +148,7 @@ func main() {
msrFile = filepath.Join(outputDir, msrFile)
} else {
baseFile := filepath.Base(msrFile)
msrFile = filepath.Join("/tmp/external/output", baseFile)
msrFile = filepath.Join("/tmp/extern/output", baseFile)
}
outputFiles = append(outputFiles, msrFile)
}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ require (
github.com/iti/evt/evtm v0.1.4
github.com/iti/evt/vrtime v0.1.5
github.com/iti/mrnes v0.0.16
github.com/iti/pces v0.0.12
github.com/iti/pces v0.0.13
github.com/iti/rngstream v0.2.2
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c
golang.org/x/exp v0.0.0-20241210194714-1829a127f884
)

require (
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ github.com/iti/evt/vrtime v0.1.5 h1:5d2O3ZGb9OruBkBxZ1PzyXBlHkAUmW27jz9fUXHc6MI=
github.com/iti/evt/vrtime v0.1.5/go.mod h1:NtgQQ20CSeaLxWNsAROKuHtAdeXNZ86Wg6ox2l5LtrU=
github.com/iti/mrnes v0.0.16 h1:TiyBzSFo4teG0EvKjbdOPHhvC6HywDmGmVRRtD06wkI=
github.com/iti/mrnes v0.0.16/go.mod h1:1P8kC384qaei5i84ZK42VYDrXmRLiYZHmx52yeLL37E=
github.com/iti/pces v0.0.12 h1:bggUNxGbC3DTgMyH8X/n0GyNvWSAYOVswn+erskAbqw=
github.com/iti/pces v0.0.12/go.mod h1:YvZkVcKJkgt7o4G1RLIoaqJ+JanofW6Kpyd0j0tvi9s=
github.com/iti/pces v0.0.13 h1:5WoM6X/rNH8YQS4uiwACT8euMLm/JokMyiFAbQdaWsw=
github.com/iti/pces v0.0.13/go.mod h1:YvZkVcKJkgt7o4G1RLIoaqJ+JanofW6Kpyd0j0tvi9s=
github.com/iti/rngstream v0.2.2 h1:9cfSikwWPW1Yie+RjdJ23uUuMryLu+Ou38/TChYLPZ8=
github.com/iti/rngstream v0.2.2/go.mod h1:sf9vdWtEjVW4dxOocgIqbivkNIrfcl10H8jEeeqFNnQ=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY=
golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8=
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 h1:Y/Mj/94zIQQGHVSv1tTtQBDaQaJe62U9bkDZKKyhPCU=
golang.org/x/exp v0.0.0-20241210194714-1829a127f884/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c=
gonum.org/v1/gonum v0.15.1 h1:FNy7N6OUZVUaWG9pTiD+jlhdQ3lMP+/LcTpJ6+a8sQ0=
gonum.org/v1/gonum v0.15.1/go.mod h1:eZTZuRFrzu5pcyjN5wJhcIhnUdNijYxX1T2IcrOGY0o=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down

0 comments on commit de296f9

Please sign in to comment.