[infinispan-dev] A tool for adjusting configuration

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

[infinispan-dev] A tool for adjusting configuration

Sebastian Laskawiec
Hey,

Our cloud integration bits require a tool for adjusting the configuration for certain use cases. A common example would be - take this `cloud.xml` file, remove all caches, add a new, replicated cache as default one.

The tool should take either configuration or a file name as input (e.g. `config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml | config-tool --add-default-cache > cloud-new.xml`) and print out configuration either to System Out or to a file.

Do you have any ideas what could I use to write such a tool? Those technologies come into my mind:
  • Perl
  • Python
  • Java (probably with some XPath library)
Thoughts? Ideas? Recommendations?

Thanks,
Sebastian
--

SEBASTIAN ŁASKAWIEC

INFINISPAN DEVELOPER


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] A tool for adjusting configuration

Katia Aresti
Hi !

What about Golang ?

Cheers,

Katia

On Mon, Aug 28, 2017 at 1:41 PM, Sebastian Laskawiec <[hidden email]> wrote:
Hey,

Our cloud integration bits require a tool for adjusting the configuration for certain use cases. A common example would be - take this `cloud.xml` file, remove all caches, add a new, replicated cache as default one.

The tool should take either configuration or a file name as input (e.g. `config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml | config-tool --add-default-cache > cloud-new.xml`) and print out configuration either to System Out or to a file.

Do you have any ideas what could I use to write such a tool? Those technologies come into my mind:
  • Perl
  • Python
  • Java (probably with some XPath library)
Thoughts? Ideas? Recommendations?

Thanks,
Sebastian
--

SEBASTIAN ŁASKAWIEC

INFINISPAN DEVELOPER


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] A tool for adjusting configuration

Galder Zamarreño
In reply to this post by Sebastian Laskawiec
Before you start messing with XML itself, you might want to see what we do in Hibernate 2L.

We first load the XML configuration [1], and using the ConfigurationBuilderHolder we can swap cache configurations, we can tweak them...etc, and eventually we create a cache manager out of that.

From the tweaked configuration, you could potentiallt chuck out XML. That's a better approach IMO than using XPath or similar tech.

Cheers,

[1] https://github.com/infinispan/infinispan/blob/master/hibernate-cache/src/main/java/org/infinispan/hibernate/cache/InfinispanRegionFactory.java#L547

> On 28 Aug 2017, at 13:41, Sebastian Laskawiec <[hidden email]> wrote:
>
> Hey,
>
> Our cloud integration bits require a tool for adjusting the configuration for certain use cases. A common example would be - take this `cloud.xml` file, remove all caches, add a new, replicated cache as default one.
>
> The tool should take either configuration or a file name as input (e.g. `config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml | config-tool --add-default-cache > cloud-new.xml`) and print out configuration either to System Out or to a file.
>
> Do you have any ideas what could I use to write such a tool? Those technologies come into my mind:
> • Perl
> • Python
> • Java (probably with some XPath library)
> Thoughts? Ideas? Recommendations?
>
> Thanks,
> Sebastian
> --
> SEBASTIAN ŁASKAWIEC
> INFINISPAN DEVELOPER
> Red Hat EMEA
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Infinispan, Red Hat


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] A tool for adjusting configuration

Dan Berindei
In reply to this post by Katia Aresti
I suggest Java, any other language will be used as an excuse to leave all the maintenance work to you :)

Dan


On Mon, Aug 28, 2017 at 5:05 PM, Katia Aresti <[hidden email]> wrote:
Hi !

What about Golang ?

Cheers,

Katia

On Mon, Aug 28, 2017 at 1:41 PM, Sebastian Laskawiec <[hidden email]> wrote:
Hey,

Our cloud integration bits require a tool for adjusting the configuration for certain use cases. A common example would be - take this `cloud.xml` file, remove all caches, add a new, replicated cache as default one.

The tool should take either configuration or a file name as input (e.g. `config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml | config-tool --add-default-cache > cloud-new.xml`) and print out configuration either to System Out or to a file.

Do you have any ideas what could I use to write such a tool? Those technologies come into my mind:
  • Perl
  • Python
  • Java (probably with some XPath library)
Thoughts? Ideas? Recommendations?

Thanks,
Sebastian
--

SEBASTIAN ŁASKAWIEC

INFINISPAN DEVELOPER


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] A tool for adjusting configuration

Tristan Tarrant-2
In reply to this post by Sebastian Laskawiec
For server the tool already exists: the server CLI can work in offline
mode and manipulate a configuration using DMR ops.

Tristan

On 8/28/17 1:41 PM, Sebastian Laskawiec wrote:

> Hey,
>
> Our cloud integration bits require a tool for adjusting the
> configuration for certain use cases. A common example would be - take
> this `cloud.xml` file, remove all caches, add a new, replicated cache as
> default one.
>
> The tool should take either configuration or a file name as input (e.g.
> `config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml |
> config-tool --add-default-cache > cloud-new.xml`) and print out
> configuration either to System Out or to a file.
>
> Do you have any ideas what could I use to write such a tool? Those
> technologies come into my mind:
>
>   * Perl
>   * Python
>   * Java (probably with some XPath library)
>
> Thoughts? Ideas? Recommendations?
>
> Thanks,
> Sebastian
> --
>
> SEBASTIANŁASKAWIEC
>
> INFINISPAN DEVELOPER
>
> Red HatEMEA <https://www.redhat.com/>
>
> <https://red.ht/sig>
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>

--
Tristan Tarrant
Infinispan Lead
JBoss, a division of Red Hat
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] A tool for adjusting configuration

Sebastian Laskawiec
Thanks a lot for all tips.

It seems Tristan's solution fits the best. I've just tried it out and it seems to do the job:
> ./cli.sh
> embed-server --server-config=cloud.xml --std-out=echo
> /subsystem=datagrid-infinispan-endpoint/rest-connector=rest-connector:remove
> stop-embedded-server

I might wrap some of the commands with a simple bash script (e.g. when I need to incorporate it into larger commands including grep, awk or sed) but it's more or less what I needed.

Thanks,
Sebastian


On Mon, Aug 28, 2017 at 7:46 PM Tristan Tarrant <[hidden email]> wrote:
For server the tool already exists: the server CLI can work in offline
mode and manipulate a configuration using DMR ops.

Tristan

On 8/28/17 1:41 PM, Sebastian Laskawiec wrote:
> Hey,
>
> Our cloud integration bits require a tool for adjusting the
> configuration for certain use cases. A common example would be - take
> this `cloud.xml` file, remove all caches, add a new, replicated cache as
> default one.
>
> The tool should take either configuration or a file name as input (e.g.
> `config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml |
> config-tool --add-default-cache > cloud-new.xml`) and print out
> configuration either to System Out or to a file.
>
> Do you have any ideas what could I use to write such a tool? Those
> technologies come into my mind:
>
>   * Perl
>   * Python
>   * Java (probably with some XPath library)
>
> Thoughts? Ideas? Recommendations?
>
> Thanks,
> Sebastian
> --
>
> SEBASTIANŁASKAWIEC
>
> INFINISPAN DEVELOPER
>
> Red HatEMEA <https://www.redhat.com/>
>
> <https://red.ht/sig>
>
>
> _______________________________________________
> infinispan-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>

--
Tristan Tarrant
Infinispan Lead
JBoss, a division of Red Hat
_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
--

SEBASTIAN ŁASKAWIEC

INFINISPAN DEVELOPER


_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev
Reply | Threaded
Open this post in threaded view
|

Re: [infinispan-dev] A tool for adjusting configuration

Emmanuel Bernard
In reply to this post by Sebastian Laskawiec
If built-in solutions like what Tristan proposed don't work. Copnsider
Windup, it must likely have ways to transform configurations.
Windup is a generic tool to migrate from some version of X to some
versions of Y. Worth talking to the team.

Emmanuel

On Mon 17-08-28 11:41, Sebastian Laskawiec wrote:

>Hey,
>
>Our cloud integration bits require a tool for adjusting the configuration
>for certain use cases. A common example would be - take this `cloud.xml`
>file, remove all caches, add a new, replicated cache as default one.
>
>The tool should take either configuration or a file name as input (e.g.
>`config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml |
>config-tool --add-default-cache > cloud-new.xml`) and print out
>configuration either to System Out or to a file.
>
>Do you have any ideas what could I use to write such a tool? Those
>technologies come into my mind:
>
>   - Perl
>   - Python
>   - Java (probably with some XPath library)
>
>Thoughts? Ideas? Recommendations?
>
>Thanks,
>Sebastian
>--
>
>SEBASTIAN ŁASKAWIEC
>
>INFINISPAN DEVELOPER
>
>Red Hat EMEA <https://www.redhat.com/>
><https://red.ht/sig>

>_______________________________________________
>infinispan-dev mailing list
>[hidden email]
>https://lists.jboss.org/mailman/listinfo/infinispan-dev

_______________________________________________
infinispan-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/infinispan-dev