Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide providers.xml externally #20

Closed
aleksandrkislitsyn opened this issue Mar 26, 2020 · 2 comments
Closed

Provide providers.xml externally #20

aleksandrkislitsyn opened this issue Mar 26, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@aleksandrkislitsyn
Copy link

Hello,

if i try to provide "providers.xml" by mounting file, i get error:

unable to chmod temp file: chmod /opt/nifi-registry/nifi-registry-0.5.0/conf/providers.xml: operation not permitte

the docs say:

providers.xml is templated iff FLOW_PROVIDER is set

but it looks like providers.xml is always templated because these environment variables are set in dockerfile:

ENV FLOW_PROVIDER file
ENV FLOW_PROVIDER_GIT_FLOW_STORAGE_DIRECTORY $PROJECT_BASE_DIR/flow-storage
ENV FLOW_PROVIDER_FILE_FLOW_STORAGE_DIRECTORY $PROJECT_BASE_DIR/flow-storage

@michalklempa
Copy link
Owner

Hi,
thank you for submitting the issue.

You are right. The variables are set. I was thinking about removing then from Dockerfile, but that would remove also the convenient method for those who are only testing do not care yet, where the flows are stored.

I took a look into https://github.com/michalklempa/docker-nifi-registry/blob/develop/sh/start.sh#L86
The test is based on string length. It is possible to override the value set in Dockerfile by setting this variable to empty string:

docker run --name nifi-registry \
      -p 18080:18080 \
      -e 'FLOW_PROVIDER=' \
      -v $PWD/conf/bootstrap.conf:/opt/nifi-registry/nifi-registry-0.5.0/conf/bootstrap.conf \
      -v $PWD/conf/nifi-registry.properties:/opt/nifi-registry/nifi-registry-0.5.0/conf/nifi-registry.properties \
      -v $PWD/conf/authorizers.xml:/opt/nifi-registry/nifi-registry-0.5.0/conf/authorizers.xml \
      -v $PWD/conf/identity-providers.xml:/opt/nifi-registry/nifi-registry-0.5.0/conf/identity-providers.xml \
      -v $PWD/conf/providers.xml:/opt/nifi-registry/nifi-registry-0.5.0/conf/providers.xml \
      -d \
      michalklempa/nifi-registry:latest

Would it be okay hotfix for you?

When talking about this, I can see, that the logic based on 'is any of the variables in the template set' is ok for boostrap.conf and nifi-registry.properties, because the if statement tests exactly this:
https://github.com/michalklempa/docker-nifi-registry/blob/develop/sh/start.sh#L77

I will have to

  1. update the docs
  2. rethink the condition
  • adding some meta-variable
  • or re-working the test in start.sh
  1. give an option to turn templating on/off as a whole

What is you opinion?

@michalklempa michalklempa self-assigned this Apr 2, 2020
@michalklempa michalklempa added the bug Something isn't working label Apr 2, 2020
@michalklempa michalklempa pinned this issue Apr 2, 2020
@michalklempa
Copy link
Owner

michalklempa commented Apr 3, 2020

Hi @aleksandrkislitsyn ,
I have decided to make an image flavour with docker tag -plain. These images do not set UID:GID (nifi:nifi) and do not set variables you mentioned. No template rendering is done at all.

Try: https://hub.docker.com/layers/michalklempa/nifi-registry/0.5.0-plain/images/sha256-48e7ac738ae19146cd68672ce414dafae29937edbcd985a10fa3712c14a334f9?context=repo

@michalklempa michalklempa unpinned this issue Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants