Skip to content

move the creation of the config.json file into a RUN directive #185

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

Merged
merged 2 commits into from
Sep 8, 2016
Merged

move the creation of the config.json file into a RUN directive #185

merged 2 commits into from
Sep 8, 2016

Conversation

ddavison
Copy link
Member

You would think that this is a no-op, but it's not. This was actually creating an issue when running Docker containers in succession with Kubernetes and OpenShift.

This change won't affect other users using this without Kubernetes and OpenShift. Due to the nature that some Docker containers won't be safe - OpenShift enforces a policy of an arbitrary user ID that has sudo'ers rather than running as root.

@ddavison
Copy link
Member Author

weird.. ^ I'll look into the failure. worked fine for me earlier.

@ddavison
Copy link
Member Author

looks like an issue with circleci, and not able to write to /opt/selenium properly ? I have a completely identical repository:

$ docker pull ddavison/docker-selenium-ephemeral which just contains the changes above, and works just fine locally.

screen shot 2016-03-22 at 11 56 03 am

@ddavison
Copy link
Member Author

ddavison commented Apr 1, 2016

docker committers, could somebody help me with this? 😅

@kayabendroth kayabendroth self-assigned this Apr 9, 2016
@ddavison
Copy link
Member Author

ddavison commented May 10, 2016

poke, docker committers. if you need to talk to me in #selenium irc, i'm sircapsalot

@elgalu
Copy link
Member

elgalu commented May 11, 2016

This looks wrong, taking it away from the entry_point.sh will prevent users to change the config at run time.

@ddavison
Copy link
Member Author

ddavison commented May 11, 2016

line 22 chowns the whole directory to seluser, so users will be able to change the config at run time

@elgalu
Copy link
Member

elgalu commented May 11, 2016

Sorry, took a slight look and seems I wrote some none-sense.

@ddavison
Copy link
Member Author

i wouldn't mind merging this guys, but i wasn't involved with the circleci stuff. it looks like our CI is broken for this project

@ddavison ddavison merged commit 0d4bd48 into SeleniumHQ:master Sep 8, 2016
@ddavison ddavison deleted the allow-agnostic branch September 8, 2016 13:21
@gerich-home
Copy link

Agree with @elgalu

Due to this change I am not able to change the value of config options in docker-compose file:

  hub:
    image: selenium/hub
    environment:
      - GRID_TIMEOUT=36000

I see that my change has no effect (it is critical!).

I try ssh'ing into container:

docker ps
CONTAINER ID        IMAGE                         COMMAND                  CREATED              STATUS              PORTS
                             NAMES
...
357362562d6f        selenium/hub                  "/opt/bin/entry_point"   About a minute ago   Up About a minute   4444/tcp
                             e2e_hub_1
...

docker exec -it 357362562d6f sh

There I view config.json and see that it has default content in it!

$ cat /opt/selenium/config.json

{
  "host": null,
  "port": 4444,
  "prioritizer": null,
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "newSessionWaitTimeout": -1,
  "jettyMaxThreads": -1,
  "nodePolling": 5000,
  "cleanUpCycle": 5000,
  "timeout": 30000,
  "browserTimeout": 0,
  "maxSession": 5,
  "unregisterIfStillDownAfter": 30000
}

I try regenerating it manually:

$ /opt/selenium/generate_config > /opt/selenium/config.json

And it now contains valid values:

$ cat /opt/selenium/config.json

{
  "host": null,
  "port": 4444,
  "prioritizer": null,
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "newSessionWaitTimeout": -1,
  "jettyMaxThreads": -1,
  "nodePolling": 5000,
  "cleanUpCycle": 5000,
  "timeout": 36000,
  "browserTimeout": 0,
  "maxSession": 5,
  "unregisterIfStillDownAfter": 30000
}

I vote reverting the change as it broke the ability to configure hub!

@ddavison
Copy link
Member Author

looking into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants