#variant (2019-05)

https://github.com/mumoshu/variant

Discuss variant (the “Universal CLI”) https://github.com/mumoshu/variant

Archive: https://archive.sweetops.com/variant/

2019-05-01

tolstikov avatar
tolstikov
bug: If config-file option is set then environment specific config files can't be loaded · Issue #78 · mumoshu/variant

what If config-file option is set then environment specific config files can't be loaded. why We want to be able to set the config file through the option and still be able to use environment s…

1

2019-05-03

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
Add deps command by osterman · Pull Request #466 · cloudposse/geodesic

what Add a command to install/uninstall remote dependencies defined by any source url why Mimic the terraform init -from-module=… pattern for anything as a way to initialize a project from rem…

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

any thoughts?

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

this is like your anydeps but uses variant without overloading helm as package manager.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

(as you can see the motivation is for #helmfile to fetch releases)

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

but will be also used to fetch binaries

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

though I confess i wrote this without looking at anydep and now that I do see a bunch of things I can do better

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
mumoshu/anydep

General-purpose project/application dependency manager - mumoshu/anydep

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

also, I’m bummed that helm-s3 still doesn’t support public repos

mumoshu/anydep

General-purpose project/application dependency manager - mumoshu/anydep

mumoshu avatar
mumoshu

yep, we shouldn’t be tied to helm-s3 nor s3.

anydep can be enhanced to leverage any helm plugin.

so perhaps we can add another backend (http, github, etc) to anydep and serve both use-cases of mine and your deps

2019-05-04

mumoshu avatar
mumoshu

@Erik Osterman (Cloud Posse) I believe your approach does work and simpler, which is nice!

Your assumption would be that you don’t need transitive dependencies to be handled, right?

2019-05-07

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

yea, not for this stage

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

no deps of deps

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

i think a “package” system would be better then; perhaps why you chose helm

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

@mumoshu have you considered a “default” command? e.g. if none of the args match, pass $* to some command

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

e.g. terraformctl would intercept any task defined, but if not defined, it would pass to terraform

mumoshu avatar
mumoshu

Haven’t tested it with deeply nested commands, but I’ve added the initial support for default commands.

The top-level script is run when if is defined and no sub-task that matches the provided arguments found.

https://github.com/mumoshu/variant#default-command

mumoshu/variant

Wrap up your bash scripts into a modern CLI today. Graduate to a full-blown golang app tomorrow. - mumoshu/variant

mumoshu avatar
mumoshu

its available since v0.29

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

wow, that’s clever. I like how you kept it consistent with the rest of variant. hadn’t thought to implement it that way, but i like it.

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

basically, using variant to overload commands

1
mumoshu avatar
mumoshu

@Erik Osterman (Cloud Posse) sounds like a great addition to variant!

2019-05-08

mumoshu avatar
mumoshu

@Erik Osterman (Cloud Posse) For variant (and also helmfile potentially) I got to think that we eventually need a tool like this:

https://github.com/mumoshu/versadep/blob/master/README.md

WDYT?

mumoshu/versadep

Versatile application dependency manager. Version, fetch, and generate any files and binaries required to run your application - mumoshu/versadep

mumoshu avatar
mumoshu

the example config doesn’t make sense at all. please take it as purely for showing how the config syntax look like

mumoshu/versadep

Versatile application dependency manager. Version, fetch, and generate any files and binaries required to run your application - mumoshu/versadep

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Wow, yes, I think you are on to something

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Sec developing/forming opinion

1
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Consider adding semver

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
gruntwork-io/fetch

fetch makes it easy to download files, folders, and release assets from a specific git commit, branch, or tag of public and private GitHub repos. - gruntwork-io/fetch

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

But that is more for GitHub tags/release

mumoshu avatar
mumoshu

thx for sharing!

mumoshu avatar
mumoshu

probably we need to explore more sources other than github tags/releases as well, like curl from any http sources as your deps

mumoshu avatar
mumoshu

probably what need for versadep would look something like a declarative fetch + additional sources?

mumoshu avatar
mumoshu

oh, and i wanted versadep to setup PATH for us, like rbenv does for ruby

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Aha so you can vendor everything

mumoshu avatar
mumoshu

exactly!

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Btw have you ever explored terraform vendoring? Not easy

mumoshu avatar
mumoshu

not at all. i’d love to know your experience!

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

For modules.. that nest modules. Only bringing it up because it’s something we’ve been tasked with solving at some point

1
mumoshu avatar
mumoshu

can you nest terraform modules? i wonder how it works when multiple modules refer to/nest different versions of the module

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

yep, we do extreme nesting

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

sometimes 3-4 levels deep. maybe more.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

terraform clones every reference of a module to .terraform/modules

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

each one checked out to the version referenced

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

it uses some hashed folder which is presumably the github url with version info

mumoshu avatar
mumoshu
feat: default commands · Issue #85 · mumoshu/variant

Extracted from our official slack channel: have you considered a "default" command? e.g. if none of the args match, pass $* to some command (edited) e.g. terraformctl would intercept any …

2019-05-09

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)
1
1
rohit avatar

I just came to know about variant

rohit avatar

i am not sure what advantage does variant have over regular bash scripts

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

consistent interface

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

proper arg validatin

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

very terse

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

most bash scripts have very poor argument handling

mumoshu avatar
mumoshu

yep, and it provides a “upgrade path” to a golang app

mumoshu avatar
mumoshu

you can use variant build and some scripts to produce a single executable that runs without variant

mumoshu avatar
mumoshu

and even add extra commands written in golang to your cmd written in yaml

mumoshu avatar
mumoshu

so if you feel outgrown from bash, variant allows you to gradually/fully migrate to golang.

rohit avatar

it is currently flying over my head, i will have to check it out

1
rohit avatar

i guess i will start with @Erik Osterman (Cloud Posse) intro video

1
rohit avatar
cloudposse/geodesic

Geodesic is a cloud automation shell. It's the fastest way to get up and running with a rock solid, production grade cloud platform built on top of strictly Open Source tools. ★ this repo! h…

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Yes

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Everything new we do is in variant

3

2019-05-10

tolstikov avatar
tolstikov

@rohit I think about it like this: makefile is good for the wrapping bash scripts (and other executables), and variant is better than makefile to do it

2
2

2019-05-11

Maycon Santos avatar
Maycon Santos
07:04:46 PM

@Maycon Santos has joined the channel

2019-05-23

mumoshu avatar
mumoshu
feat: Markdown-based alternative syntax · Issue #86 · mumoshu/variant

As an ordinary engineer I often write documentation for my one-off scripts in GitHub Flavored Markdown. But it tends to get outdated quickly due to various reasons, including I just forget updating…

    keyboard_arrow_up