summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorJaka Hudoklin <offlinehacker@users.noreply.github.com>2018-05-05 08:07:14 +0200
committerGitHub <noreply@github.com>2018-05-05 08:07:14 +0200
commit3ec4528dcfc8380dfe618a08337de451277bd302 (patch)
tree0f1a2ee875d69f76efb57d333c450193382ffc32 /nixos
parent30caa09e51142e98c43f6288f55e1776fd5b625e (diff)
parentc3eefe801a55586445125d49f159c1c0c5e76f76 (diff)
downloadnixlib-3ec4528dcfc8380dfe618a08337de451277bd302.tar
nixlib-3ec4528dcfc8380dfe618a08337de451277bd302.tar.gz
nixlib-3ec4528dcfc8380dfe618a08337de451277bd302.tar.bz2
nixlib-3ec4528dcfc8380dfe618a08337de451277bd302.tar.lz
nixlib-3ec4528dcfc8380dfe618a08337de451277bd302.tar.xz
nixlib-3ec4528dcfc8380dfe618a08337de451277bd302.tar.zst
nixlib-3ec4528dcfc8380dfe618a08337de451277bd302.zip
Merge pull request #39991 from xeji/remove-fleet
fleet, panamax: remove
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/misc/ids.nix6
-rw-r--r--nixos/modules/module-list.nix2
-rw-r--r--nixos/modules/services/cluster/fleet.nix150
-rw-r--r--nixos/modules/services/cluster/panamax.nix156
-rw-r--r--nixos/release.nix2
-rw-r--r--nixos/tests/fleet.nix76
-rw-r--r--nixos/tests/panamax.nix21
7 files changed, 3 insertions, 410 deletions
diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix
index 805d83c7ce3d..cc7d86849824 100644
--- a/nixos/modules/misc/ids.nix
+++ b/nixos/modules/misc/ids.nix
@@ -190,7 +190,7 @@
       cadvisor = 167;
       nylon = 168;
       apache-kafka = 169;
-      panamax = 170;
+      #panamax = 170; # unused
       exim = 172;
       #fleet = 173; # unused
       #input = 174; # unused
@@ -474,9 +474,9 @@
       #chronos = 164; # unused
       gitlab = 165;
       nylon = 168;
-      panamax = 170;
+      #panamax = 170; # unused
       exim = 172;
-      fleet = 173;
+      #fleet = 173; # unused
       input = 174;
       sddm = 175;
       tss = 176;
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index cb4c09176789..6c4326046ef8 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -171,11 +171,9 @@
   ./services/backup/rsnapshot.nix
   ./services/backup/tarsnap.nix
   ./services/backup/znapzend.nix
-  ./services/cluster/fleet.nix
   ./services/cluster/kubernetes/default.nix
   ./services/cluster/kubernetes/dns.nix
   ./services/cluster/kubernetes/dashboard.nix
-  ./services/cluster/panamax.nix
   ./services/computing/boinc/client.nix
   ./services/computing/torque/server.nix
   ./services/computing/torque/mom.nix
diff --git a/nixos/modules/services/cluster/fleet.nix b/nixos/modules/services/cluster/fleet.nix
deleted file mode 100644
index ec03be395948..000000000000
--- a/nixos/modules/services/cluster/fleet.nix
+++ /dev/null
@@ -1,150 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-let
-  cfg = config.services.fleet;
-
-in {
-
-  ##### Interface
-  options.services.fleet = {
-    enable = mkOption {
-      type = types.bool;
-      default = false;
-      description = ''
-        Whether to enable fleet service.
-      '';
-    };
-
-    listen = mkOption {
-      type = types.listOf types.str;
-      default = [ "/var/run/fleet.sock" ];
-      example = [ "/var/run/fleet.sock" "127.0.0.1:49153" ];
-      description = ''
-        Fleet listening addresses.
-      '';
-    };
-
-    etcdServers = mkOption {
-      type = types.listOf types.str;
-      default = [ "http://127.0.0.1:2379" ];
-      description = ''
-        Fleet list of etcd endpoints to use.
-      '';
-    };
-
-    publicIp = mkOption {
-      type = types.nullOr types.str;
-      default = "";
-      description = ''
-        Fleet IP address that should be published with the local Machine's
-        state and any socket information. If not set, fleetd will attempt
-        to detect the IP it should publish based on the machine's IP
-        routing information.
-      '';
-    };
-
-    etcdCafile = mkOption {
-      type = types.nullOr types.path;
-      default = null;
-      description = ''
-        Fleet TLS ca file when SSL certificate authentication is enabled
-        in etcd endpoints.
-      '';
-    };
-
-    etcdKeyfile = mkOption {
-      type = types.nullOr types.path;
-      default = null;
-      description = ''
-        Fleet TLS key file when SSL certificate authentication is enabled
-        in etcd endpoints.
-      '';
-    };
-
-    etcdCertfile = mkOption {
-      type = types.nullOr types.path;
-      default = null;
-      description = ''
-        Fleet TLS cert file when SSL certificate authentication is enabled
-        in etcd endpoints.
-      '';
-    };
-
-    metadata = mkOption {
-      type = types.attrsOf types.str;
-      default = {};
-      apply = attrs: concatMapStringsSep "," (n: "${n}=${attrs."${n}"}") (attrNames attrs);
-      example = literalExample ''
-        {
-          region = "us-west";
-          az = "us-west-1";
-        }
-      '';
-      description = ''
-        Key/value pairs that are published with the local to the fleet registry.
-        This data can be used directly by a client of fleet to make scheduling decisions.
-      '';
-    };
-
-    extraConfig = mkOption {
-      type = types.attrsOf types.str;
-      apply = mapAttrs' (n: v: nameValuePair ("FLEET_" + n) v);
-      default = {};
-      example = literalExample ''
-        {
-          VERBOSITY = 1;
-          ETCD_REQUEST_TIMEOUT = "2.0";
-          AGENT_TTL = "40s";
-        }
-      '';
-      description = ''
-        Fleet extra config. See
-        <link xlink:href="https://github.com/coreos/fleet/blob/master/Documentation/deployment-and-configuration.md"/>
-        for configuration options.
-      '';
-    };
-
-  };
-
-  ##### Implementation
-  config = mkIf cfg.enable {
-    systemd.services.fleet = {
-      description = "Fleet Init System Daemon";
-      wantedBy = [ "multi-user.target" ];
-      after = [ "network.target" "fleet.socket" "etcd.service" "docker.service" ];
-      requires = [ "fleet.socket" ];
-      environment = {
-        FLEET_ETCD_SERVERS = concatStringsSep "," cfg.etcdServers;
-        FLEET_PUBLIC_IP = cfg.publicIp;
-        FLEET_ETCD_CAFILE = cfg.etcdCafile;
-        FLEET_ETCD_KEYFILE = cfg.etcdKeyfile;
-        FLEET_ETCD_CERTFILE = cfg.etcdCertfile;
-        FLEET_METADATA = cfg.metadata;
-      } // cfg.extraConfig;
-      serviceConfig = {
-        ExecStart = "${pkgs.fleet}/bin/fleetd";
-        Group = "fleet";
-      };
-    };
-
-    systemd.sockets.fleet = {
-      description = "Fleet Socket for the API";
-      wantedBy = [ "sockets.target" ];
-      listenStreams = cfg.listen;
-      socketConfig = {
-        ListenStream = "/var/run/fleet.sock";
-        SocketMode = "0660";
-        SocketUser = "root";
-        SocketGroup = "fleet";
-      };
-    };
-
-    services.etcd.enable = mkDefault true;
-    virtualisation.docker.enable = mkDefault true;
-
-    environment.systemPackages = [ pkgs.fleet ];
-    users.extraGroups.fleet.gid = config.ids.gids.fleet;
-  };
-}
diff --git a/nixos/modules/services/cluster/panamax.nix b/nixos/modules/services/cluster/panamax.nix
deleted file mode 100644
index 4475e8d8c24b..000000000000
--- a/nixos/modules/services/cluster/panamax.nix
+++ /dev/null
@@ -1,156 +0,0 @@
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-let
-  cfg = config.services.panamax;
-
-  panamax_api = pkgs.panamax_api.override { dataDir = cfg.dataDir + "/api"; };
-  panamax_ui = pkgs.panamax_ui.override { dataDir = cfg.dataDir + "/ui"; };
-
-in {
-
-  ##### Interface
-  options.services.panamax = {
-    enable = mkOption {
-      type = types.bool;
-      default = false;
-      description = ''
-        Whether to enable Panamax service.
-      '';
-    };
-
-    UIPort = mkOption {
-      type = types.int;
-      default = 8888;
-      description = ''
-        Panamax UI listening port.
-      '';
-    };
-
-    APIPort = mkOption {
-      type = types.int;
-      default = 3000;
-      description = ''
-        Panamax UI listening port.
-      '';
-    };
-
-    dataDir = mkOption {
-      type = types.str;
-      default = "/var/lib/panamax";
-      description = ''
-        Data dir for Panamax.
-      '';
-    };
-
-    fleetctlEndpoint = mkOption {
-      type = types.str;
-      default = "http://127.0.0.1:2379";
-      description = ''
-        Panamax fleetctl endpoint.
-      '';
-    };
-
-    journalEndpoint = mkOption {
-      type = types.str;
-      default = "http://127.0.0.1:19531";
-      description = ''
-        Panamax journal endpoint.
-      '';
-    };
-
-    secretKey = mkOption {
-      type = types.str;
-      default = "SomethingVeryLong.";
-      description = ''
-        Panamax secret key (do change this).
-      '';
-    };
-
-  };
-
-  ##### Implementation
-  config = mkIf cfg.enable {
-    systemd.services.panamax-api = {
-      description = "Panamax API";
-
-      wantedBy = [ "multi-user.target" ];
-      after = [ "network.target" "fleet.service" "etcd.service" "docker.service" ];
-
-      path = [ panamax_api ];
-      environment = {
-        RAILS_ENV = "production";
-        JOURNAL_ENDPOINT = cfg.journalEndpoint;
-        FLEETCTL_ENDPOINT = cfg.fleetctlEndpoint;
-        PANAMAX_DATABASE_PATH = "${cfg.dataDir}/api/db/mnt/db.sqlite3";
-      };
-
-      preStart = ''
-        rm -rf ${cfg.dataDir}/state/tmp
-        mkdir -p ${cfg.dataDir}/api/{db/mnt,state/log,state/tmp}
-        ln -sf ${panamax_api}/share/panamax-api/_db/{schema.rb,seeds.rb,migrate} ${cfg.dataDir}/api/db/
-
-        if [ ! -f ${cfg.dataDir}/.created ]; then
-          bundle exec rake db:setup
-          bundle exec rake db:seed
-          bundle exec rake panamax:templates:load || true
-          touch ${cfg.dataDir}/.created
-        else
-          bundle exec rake db:migrate
-        fi
-      '';
-
-      serviceConfig = {
-        ExecStart = "${panamax_api}/bin/bundle exec rails server --binding 127.0.0.1 --port ${toString cfg.APIPort}";
-        User = "panamax";
-        Group = "panamax";
-      };
-    };
-
-    systemd.services.panamax-ui = {
-      description = "Panamax UI";
-
-      wantedBy = [ "multi-user.target" ];
-      after = [ "network.target" "panamax_api.service" ];
-
-      path = [ panamax_ui ];
-      environment = {
-        RAILS_ENV = "production";
-        JOURNAL_ENDPOINT = cfg.journalEndpoint;
-        PMX_API_PORT_3000_TCP_ADDR = "localhost";
-        PMX_API_PORT_3000_TCP_PORT = toString cfg.APIPort;
-        SECRET_KEY_BASE = cfg.secretKey;
-      };
-
-      preStart = ''
-        mkdir -p ${cfg.dataDir}/ui/state/{log,tmp}
-        chown -R panamax:panamax ${cfg.dataDir}
-      '';
-
-      serviceConfig = {
-        ExecStart = "${panamax_ui}/bin/bundle exec rails server --binding 127.0.0.1 --port ${toString cfg.UIPort}";
-        User = "panamax";
-        Group = "panamax";
-        PermissionsStartOnly = true;
-      };
-    };
-
-    users.extraUsers.panamax =
-    { uid = config.ids.uids.panamax;
-      description = "Panamax user";
-      createHome = true;
-      home = cfg.dataDir;
-      extraGroups = [ "docker" ];
-    };
-
-    services.journald.enableHttpGateway = mkDefault true;
-    services.fleet.enable = mkDefault true;
-    services.cadvisor.enable = mkDefault true;
-    services.cadvisor.port = mkDefault 3002;
-    virtualisation.docker.enable = mkDefault true;
-
-    environment.systemPackages = [ panamax_api panamax_ui ];
-    users.extraGroups.panamax.gid = config.ids.gids.panamax;
-  };
-}
diff --git a/nixos/release.nix b/nixos/release.nix
index 5b6640f1d3cc..55b4f19b8688 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -284,7 +284,6 @@ in rec {
   tests.ferm = callTest tests/ferm.nix {};
   tests.firefox = callTest tests/firefox.nix {};
   tests.firewall = callTest tests/firewall.nix {};
-  tests.fleet = callTestOnMatchingSystems ["x86_64-linux"] tests/fleet.nix {};
   tests.fwupd = callTest tests/fwupd.nix {};
   #tests.gitlab = callTest tests/gitlab.nix {};
   tests.gitolite = callTest tests/gitolite.nix {};
@@ -360,7 +359,6 @@ in rec {
   tests.openldap = callTest tests/openldap.nix {};
   tests.owncloud = callTest tests/owncloud.nix {};
   tests.pam-oath-login = callTest tests/pam-oath-login.nix {};
-  #tests.panamax = callTestOnMatchingSystems ["x86_64-linux"] tests/panamax.nix {};
   tests.peerflix = callTest tests/peerflix.nix {};
   tests.php-pcre = callTest tests/php-pcre.nix {};
   tests.postgresql = callSubTests tests/postgresql.nix {};
diff --git a/nixos/tests/fleet.nix b/nixos/tests/fleet.nix
deleted file mode 100644
index 67c95446526f..000000000000
--- a/nixos/tests/fleet.nix
+++ /dev/null
@@ -1,76 +0,0 @@
-import ./make-test.nix ({ pkgs, ...} : rec {
-  name = "simple";
-  meta = with pkgs.stdenv.lib.maintainers; {
-    maintainers = [ offline ];
-  };
-
-  nodes = {
-    node1 =
-      { config, pkgs, ... }:
-        {
-          services = {
-            etcd = {
-              enable = true;
-              listenPeerUrls = ["http://0.0.0.0:7001"];
-              initialAdvertisePeerUrls = ["http://node1:7001"];
-              initialCluster = ["node1=http://node1:7001" "node2=http://node2:7001"];
-            };
-         };
-
-          services.fleet = {
-            enable = true;
-            metadata.name = "node1";
-          };
-
-          networking.firewall.allowedTCPPorts = [ 7001 ];
-        };
-
-    node2 =
-      { config, pkgs, ... }:
-        {
-          services = {
-            etcd = {
-              enable = true;
-              listenPeerUrls = ["http://0.0.0.0:7001"];
-              initialAdvertisePeerUrls = ["http://node2:7001"];
-              initialCluster = ["node1=http://node1:7001" "node2=http://node2:7001"];
-            };
-           };
-
-          services.fleet = {
-            enable = true;
-            metadata.name = "node2";
-          };
-
-          networking.firewall.allowedTCPPorts = [ 7001 ];
-        };
-  };
-
-  service = builtins.toFile "hello.service" ''
-    [Unit]
-    Description=Hello World
-
-    [Service]
-    ExecStart=/bin/sh -c "while true; do echo \"Hello, world\"; /var/run/current-system/sw/bin/sleep 1; done"
-
-    [X-Fleet]
-    MachineMetadata=name=node2
-  '';
-
-  testScript =
-    ''
-      startAll;
-      $node1->waitForUnit("fleet.service");
-      $node2->waitForUnit("fleet.service");
-
-      $node2->waitUntilSucceeds("fleetctl list-machines | grep node1");
-      $node1->waitUntilSucceeds("fleetctl list-machines | grep node2");
-
-      $node1->succeed("cp ${service} hello.service && fleetctl submit hello.service");
-      $node1->succeed("fleetctl list-unit-files | grep hello");
-      $node1->succeed("fleetctl start hello.service");
-      $node1->waitUntilSucceeds("fleetctl list-units | grep running");
-      $node1->succeed("fleetctl stop hello.service");
-      $node1->succeed("fleetctl destroy hello.service");
-    '';
-})
diff --git a/nixos/tests/panamax.nix b/nixos/tests/panamax.nix
deleted file mode 100644
index 088aa79f8c61..000000000000
--- a/nixos/tests/panamax.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-import ./make-test.nix ({ pkgs, ...} : {
-  name = "panamax";
-  meta = with pkgs.stdenv.lib.maintainers; {
-    maintainers = [ offline ];
-  };
-
-  machine = { config, pkgs, ... }: {
-    services.panamax.enable = true;
-  };
-
-  testScript =
-    ''
-      startAll;
-      $machine->waitForUnit("panamax-api.service");
-      $machine->waitForUnit("panamax-ui.service");
-      $machine->waitForOpenPort(3000);
-      $machine->waitForOpenPort(8888);
-      $machine->succeed("curl --fail http://localhost:8888/ > /dev/null");
-      $machine->shutdown;
-    '';
-})