Splunk Dev

Why when installing custom made app that contains symlinks, the GUI removes all the links an breaks the app?

joshiro
Communicator

We are installing a custom made app that contains some symlinks, but were having the following problem:
Installing it from the web GUI removes all the links breaking the app.
But installing it by copying the app dir into '$SPLUNK_HOME/etc/apps'  keeps the symlinks intact, and the app works.

Is this intended behaviour?
Is there anyway to use symlinks inside an app?

Regards,
Javier.

Labels (2)
Tags (2)
0 Karma
1 Solution

joshiro
Communicator
0 Karma

mcmaster
Communicator

If this is a custom app and one you're not intending to publish to Splunkbase, one option is that you could bundle the anaconda environment in its own tgz within the app, and create a custom setup process that will extract that environment. It's clunky but that's an option.

joshiro
Communicator

We already tried something similar installing the app directly by extracting its contents to /etc/apps, and it works. But we re eventually going to publish to splunkbase, so thats not an option.

Thanks for commenting.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Why would you want a symlink within an app in the first place? Do you have duplicated files/directories in your app? Seems badly designed. Are you reaching outside of your app? Even worse design - an app should be self-contained so you can move it to another installation.

I wouldn't count on splunk's app unpacker and various methods of app distribution (deployer, deployment server, cluster manager) to preserve symlinks anyway.

joshiro
Communicator

Thanks for commenting on this issue.

I know its badly designed but the thing is we need to run some custom commands that uses cython, but Splunk's python doesn't support cython libraries, so we created an anaconda environment inside the app that contains another python3 instance with the cython libraries we need. This anaconda environment automatically creates some symlinks to binaries and libraries inside this environment.

This method of bypassing the Splunks python environment to run not supported libraries was used by the 'Python for Scientific Computing' app (https://splunkbase.splunk.com/app/2882/) and the Splunk Machine Learning Toolkit app (https://splunkbase.splunk.com/app/2890/) and we just copied it. But this implementation removes the symlinks by copying the same binaries and libraries creating duplicated files and wasting disk space.

So we need to find another way to run cython libraries inside Splunk, or keep the anaconda environment and try to make the symlinks work. Or we might just duplicate the bins and libs inside the anaconda just like the apps i mentioned earlier, but im trying to avoid it.

Tags (2)
0 Karma

joshiro
Communicator

We solved this problem using the Python for Scientific Computing environment.
https://community.splunk.com/t5/Developing-for-Splunk-Enterprise/How-to-run-python-custom-commands-w...

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...