question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Replace dependency on mikefarah/yq build container in favour of kislyuk/yq (python wrapper for jq)

See original GitHub issue

Is your task related to a problem? Please describe.

Today, che-operator uses yq from https://github.com/kislyuk/yq but the devfile and plugin registries use a DIFFERENT yq implementation from https://github.com/mikefarah/yq

And as demonstrated in https://github.com/eclipse/che-devfile-registry/pull/27 yaml processing may not always be required where a simple grep | sed scriplet can be used.

Additionally, the mikefarah/yq implementation requires building go code (or using his Alpine based image) whereas the kislyuk/yq works with both python2 and 3 as a wrapper for jq.

I’ve already prototyped a container that we can use to prebuild/preinstall yq as a build container:

https://github.com/nickboldt/containers/blob/master/ubi8-yq/Dockerfile

I will extend this approach so I can use this image in Brew/OSBS for CRW builds (it requires that the python deps be prepulled and pushed as a tarball into pkgs.devel’s dist-git lookaside cache, as we do for the CRW 1.2 stacks’ lang server deps).

Describe the solution you’d like

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:24 (24 by maintainers)

github_iconTop GitHub Comments

1reaction
l0rdcommented, Aug 28, 2019

@amisevsk PRs are ok for me. I have approved them.

1reaction
nickboldtcommented, Aug 9, 2019

Did some quick performance testing of the sed and yq options in devfile registry. Results suggest that we should use the golang yq instead of the python one as it’s much faster:

Using sed:

0.385s for ./check_mandatory_fields.sh
0.246s for ./index.sh

Using yq (mikefarah version):

0.38s for ./check_mandatory_fields.sh
0.27s for ./index.sh

Using yq (python version):

0m17.991s for ./check_mandatory_fields.sh
0m15.440s for ./index.sh

HOWEVER building this in Brew will be a bit challenging unless I just import the sources and compile it on the fly as a first stage build for the registries. Otherwise we need to maintain a 12th image container for CRW 2… or I start using cekit for templating these things.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found