Giter Club home page Giter Club logo

Comments (4)

Witcher01 avatar Witcher01 commented on August 28, 2024 1

from maelstrom.

Witcher01 avatar Witcher01 commented on August 28, 2024

Oh I see now: maelstrom seems to generate a store directory when running which holds testing data(?). That solves this issue :)

from maelstrom.

basbebe avatar basbebe commented on August 28, 2024

@Witcher01 would you be willing to share your solution?
I'm currently trying to create a flake for a dev environment including maelstrom…

from maelstrom.

basbebe avatar basbebe commented on August 28, 2024

I now have a flake that seems to work:

{
  description = "A dev environment for Fly.io Gossip Glomers challenge";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };


  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem
      (system:
        let
          pkgs = import nixpkgs {
            inherit system;
          };

          maelstrom = pkgs.stdenv.mkDerivation rec{
            name = "Maelstrom";
            version = "0.2.3";

            src = builtins.fetchTarball {
              url = "https://github.com/jepsen-io/maelstrom/releases/download/v${version}/maelstrom.tar.bz2";
              sha256 = "sha256:1hkczlbgps3sl4mh6hk49jimp6wmks8hki0bqijxsqfbf0hcakwq";
            };

            # include upstream patch (not yet in 0.2.3)
            # https://github.com/jepsen-io/maelstrom/commit/f0ce6dbc60369ec85f8cd69aa5ac953806634260
            maelstromScriptPatch = pkgs.writeShellScript "maelstrom" ''
              # A small wrapper script for invoking the Maelstrom jar, with arguments.
              SCRIPT_DIR=$( cd -- "$( dirname "$(readlink -f "''${BASH_SOURCE[0]}")" )" &> /dev/null && pwd )
              exec java -Djava.awt.headless=true -jar "''${SCRIPT_DIR}/lib/maelstrom.jar" "$@"
            '';

            installPhase = ''
              mkdir -p $out/bin
              cp -r * $out/bin/
              cp $maelstromScriptPatch $out/bin/maelstrom
            '';

          };

        in
        {
          devShell = pkgs.mkShell {
            name = "Gossip Glomers env";

            buildInputs = with pkgs; [
              maelstrom
              jdk
              graphviz
              gnuplot

              # Golang
              go
              gopls
              delve
              golint
            ];

          };
        });
}

Within a nix shell (nix develop) or using direnv the following now works:

maelstrom test -w echo --bin $(which maelstrom-echo) --node-count 1 --time-limit 10

While I also get the following lines, the rest of the script seems to run just fine:

WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix.impl.mathsops, being replaced by: #'clojure.core.matrix.impl.mathsops/abs
Warning: protocol #'clojure.core.matrix.protocols/PMathsFunctions is overwriting function abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix.protocols, being replaced by: #'clojure.core.matrix.protocols/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix, being replaced by: #'clojure.core.matrix/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.core.matrix.dataset, being replaced by: #'clojure.core.matrix/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: incanter.core, being replaced by: #'incanter.core/abs
INFO [2023-04-20 09:22:48,304] main - jepsen.cli Test options:
 {:args [],
[…]

from maelstrom.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.