Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add basic support for nix flakes #21

Merged
merged 3 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ sdks/python/client/dist/*
manifests/install.yaml
manifests/namespace-install.yaml
/logs
node_modules
result
.devenv
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ Argo is a [Cloud Native Computing Foundation (CNCF)](https://cncf.io/) hosted pr

![Screenshot](docs/assets/screenshot.png)

## Try Argo using Nix
Nix is a package manager / build tool which focusses on reproducible build environments.
Argo Workflows has some basic support for Nix which is enough to get Argo Workflows up and running with minimal effort.
Here are the steps to follow:
1. Modify the hosts file according to [this](https://argoproj.github.io/argo-workflows/running-locally/), don't worry about the other instructions.
2. Setup a k8s cluster, k3d is the recommended solution here.
3. Install [Nix](https://nixos.org/download.html).
4. Make a directory in the argo workflows folder called ".devenv".
5. Run "nix develop --extra-experimental-features nix-command --extra-experimental-features flakes" (you can add this as a default in your nix.conf file).
6. Run "devenv up".

As I said, this is still fairly barebones at the moment, any feature in the Makefile not mentioned here is excluded at the moment.
In practice this means only a "make start UI=true" equivalent is supported at the moment, there are no LDFlags set in the build, so the UI will show something similar to "0.0.0-unknown"
## Documentation

[View the docs](https://argoproj.github.io/argo-workflows/)
Expand Down
50 changes: 50 additions & 0 deletions conf.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
rec {
staticFiles = true;
version = "latest";
env = {
DEFAULT_REQUEUE_TIME = "1s";
SECURE = "false";
ALWAYS_OFFLOAD_NODE_STATUS = "false";
LOG_LEVEL = "debug";
UPPERIO_DB_DEBUG = "0";
IMAGE_NAMESPACE = "quay.io/pipekitdev";
VERSION = "${version}";
AUTH_MODE = "hybrid";
NAMESPACED = "true";
KUBE_NAMESPACE = "argo";
NAMESPACE = "${env.KUBE_NAMESPACE}";
MANAGED_NAMESPACE = "${env.KUBE_NAMESPACE}"; # same as kubeNamespace
CTRL = "true";
LOGS = "true"; # same as CTRL - not acted upon
UI = "true"; # same as CTRL
API = "true"; # same as CTRL
PLUGINS = "false";
};
controller = {
env = {
CTRL = "${env.CTRL}";
ARGO_EXECUTOR_PLUGINS = "${env.PLUGINS}";
ARGO_REMOVE_PVC_PROTECTION_FINALIZER = "true";
ARGO_PROGRESS_PATCH_TICK_DURATION = "7s";
DEFAULT_REQUEUE_TIME = "${env.DEFAULT_REQUEUE_TIME}";
LEADER_ELECTION_IDENTITY = "local";
ALWAYS_OFFLOAD_NODE_STATUS = "${env.ALWAYS_OFFLOAD_NODE_STATUS}";
OFFLOAD_NODE_STATUS_TTL = "30s";
WORKFLOW_GC_PERIOD = "30s";
UPPERIO_DB_DEBUG = "${env.UPPERIO_DB_DEBUG}";
ARCHIVED_WORKFLOW_GC_PERIOD = "30s";
};
args = "--executor-image ${env.IMAGE_NAMESPACE}/argoexec:${env.VERSION} --namespaced=${env.NAMESPACED} --managed-namespace=${env.MANAGED_NAMESPACE} --loglevel ${env.LOG_LEVEL}";
};

argoServer = {
env = {
UPPERIO_DB_DEBUG = "${env.UPPERIO_DB_DEBUG}";
};
args = "--loglevel ${env.LOG_LEVEL} server --namespaced=${env.NAMESPACED} --auth-mode ${env.AUTH_MODE} --secure=${env.SECURE} --x-frame-options=SAMEORIGIN";
};
ui = {
env = { };
args = "--cwd ui start";
};
}
4 changes: 2 additions & 2 deletions examples/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"io/ioutil"
"os"
"strings"
"path/filepath"
"strings"

"github.com/xeipuuv/gojsonschema"
"sigs.k8s.io/yaml"
Expand Down Expand Up @@ -75,7 +75,7 @@ func ValidateArgoYamlRecursively(fromPath string, skipFileNames []string) (map[s
errorDescriptions = append(errorDescriptions, fmt.Sprintf("%s in %s", err.Description(), err.Context().String()))
}
}

if !(incorrectError && len(errorDescriptions) == 1) {
failed[path] = errorDescriptions
}
Expand Down
274 changes: 274 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading