Modern Cuttlefish?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Modern Cuttlefish?

Code Wiget
Hi everyone,

Do any of you use/have/know of a “modern” version of cuttlefish? Cuttlefish is great because it allows for easy user configuration, an advanced configuration, and easy mappings, but then you create a release and get errors like this with 0 context:

Cuttlefish failed! Oh no!

You uncomment what you added, and still get a failure. Then you delete the commented section, and maybe it will decide to work.

Is there a more modern version of this for Erlang? I see the last development for Cuttlefish was years ago. I’m sure the kids these days are using something

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Modern Cuttlefish?

Code Wiget
Mariano, 

I have been using rebar3_cuttlefish for all of my projects, the issue is still there. It uses cuttlefish which is very out of date and doesn’t give any useful error information.

Joe,

Cuttlefish(https://github.com/tsloughter/rebar3_cuttlefishhttps://github.com/basho/cuttlefish) is a tool that takes configuration parameters and converts them to an erlang config file. For example, you could have a simple(.conf) file:

host = 127.0.0.1 
Port = 8883

And using mappings in a schema, you can convert that to part of a system config file (.config)
{http_app, [
     {host, “127.0.0.1”},
     {port, 8883}
]}.

It can also take multiple values from the .conf file into a larger .config file, and mutate them using translations. Its a cool tool. For example, I use it(in one use case)to set the log locations for lager using a translation. I set 

log_file = /var/log/app1/console.log
log_level = debug


And then I translate that into 


{lager_file_backend,
          [{file,"/var/log/app1/console.log"},
           {level,debug},
           {formatter,lager_default_formatter},
           {formatter_config,
               [date," ",time," [",severity,"] ",pid," ",message,
                "\n"]}]}

It makes for easy and dynamic configuration. The issue is that 1) it’s super old and unsupported, and 2) it gives no error information when there is an issue in configuration. 

On Oct 31, 2018, 5:19 AM -0400, Mariano Guerra <[hidden email]>, wrote:
On Wed, Oct 31, 2018 at 10:15 AM Mariano Guerra <[hidden email]> wrote:

On Tue, Oct 30, 2018 at 4:43 PM Code Wiget <[hidden email]> wrote:
Hi everyone,

Do any of you use/have/know of a “modern” version of cuttlefish? Cuttlefish is great because it allows for easy user configuration, an advanced configuration, and easy mappings, but then you create a release and get errors like this with 0 context:


hi, I use if for all my projects, it works pretty well with the rebar3_cuttlefish plugin (https://hex.pm/packages/rebar3_cuttlefish/)

if you want to see a setup that works check the rebar3 riak-core template https://marianoguerra.github.io/riak-core-tutorial/setup.html#install-riak-core-rebar3-template you don't need to use it, just create the project and check rebar.config and the config folder


to summarize here:

mkdir -p ~/.config/rebar3/templates
git clone https://github.com/marianoguerra/rebar3_template_riak_core.git ~/.config/rebar3/templates/rebar3_template_riak_core
rebar3 new rebar3_riak_core name=akv
cd akv make
make console

 
 
Cuttlefish failed! Oh no!


when I get that error I go to the script, add some prints and run the offending line by hand, usually it's some erlang version problem, format error or similar.

that message doesn't come from cuttlefish itself but from the script that runs it, in my case it's this line:

CUTTLEFISH_CONFIG=$($CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_GEN_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new)

which I print to the console

echo "$CUTTLEFISHCMD -e $RUNNER_ETC_DIR -d $RUNNER_GEN_DIR/generated.conf -s $RUNNER_BASE_DIR/share/schema/ -c $RUNNER_ETC_DIR/$CUTTLEFISH_CONF.new"

copy the output and run it manually to see the error details (it would be nice to print the error output with the "oh no" message, or at least a random http://webcomicname.com/ :P)
 
You uncomment what you added, and still get a failure. Then you delete the commented section, and maybe it will decide to work.

Is there a more modern version of this for Erlang? I see the last development for Cuttlefish was years ago. I’m sure the kids these days are using something
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Modern Cuttlefish?

Andrew Thompson-2
In reply to this post by Code Wiget
On Tue, Oct 30, 2018 at 11:41:31AM -0400, Code Wiget wrote:
> Hi everyone,
>
> Do any of you use/have/know of a “modern” version of cuttlefish? Cuttlefish is great because it allows for easy user configuration, an advanced configuration, and easy mappings, but then you create a release and get errors like this with 0 context:
>
> > Cuttlefish failed! Oh no!
>
> You uncomment what you added, and still get a failure. Then you delete the commented section, and maybe it will decide to work.
>
> Is there a more modern version of this for Erlang? I see the last development for Cuttlefish was years ago. I’m sure the kids these days are using something


There's several forks of cuttlefish on github that are more modern.
Maybe we can get a bunch of interested parties together and update the
basho version (I have commit access to the basho org) with the fixes
needed to make it work on OTP 20/21 and start getting PRs flowing again.

Andrew
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions