eclipse-archived / kiso

Kiso Project
Other
30 stars 31 forks source link

Remove unecessary clutter from dockerfile #204

Closed ChiefGokhlayehBosch closed 4 years ago

ChiefGokhlayehBosch commented 4 years ago

The lines I removed have little to no effect on Kiso nor Kiso-Testing. They are probably the result of some trial&error testing with Jenkins for Kiso-Testing. I think I figured out what was going wrong over there, and these changes are now obsolete, hence why I want to remove them.

Docker image tag v0.0.7 already created.

More details on how I hopefully fixed Kiso-Testing's Jenkins issues here.

These changes in the Dockerfile have no effect on the main Kiso repo, they were added during work on Kiso-Testing.

HansUweRempler commented 4 years ago

Thanks for the initiative!

Do you basically removed two questionable env vars: ENV WORKON_HOME=/kiso-project/.venvs ENV PIPENV_CACHE_DIR=/kiso-project/.cache

Hmmm, wonder why they have been added (plus adding them w/o unsing the previously defined WORKDIR /kiso-project). These vars are Python and Pip related - maybe @sebastianpfischer knows why these have been added?

ChiefGokhlayehBosch commented 4 years ago

Thanks for the initiative!

Do you basically removed two questionable env vars: ENV WORKON_HOME=/kiso-project/.venvs ENV PIPENV_CACHE_DIR=/kiso-project/.cache

Hmmm, wonder why they have been added (plus adding them w/o unsing the previously defined WORKDIR /kiso-project). These vars are Python and Pip related - maybe @sebastianpfischer knows why these have been added?

They indeed are related to pipenv used in Kiso-Testing. WORKON_HOME controls where pipenv will store the virtual python environment, usually this is $HOME/.local/virtualenvs/..., but because Eclipse Jenkins executes jobs with a random user without home-dir, this would've failed. Same goes for PIPENV_CACHE_DIR. However, a better way to set these environment variables is during the Jenkins build, NOT globally for the entire Docker image (as seen in my prototype branch).

A normal developer doesn't have the issue of running with a random user. These environment variable tweaks are only necessary when executing in a specific Jenkins environment. Thus we should do the tweaking in Jenkinsfile.

HansUweRempler commented 4 years ago

However, a better way to set these environment variables is during the Jenkins build, NOT globally for the entire Docker image

Why? I mean, where is pip actually used, in Jenkinsfile as a command or in Dockerfile as a command (to install Something, Something, Something, Dark Side)?

ChiefGokhlayehBosch commented 4 years ago

However, a better way to set these environment variables is during the Jenkins build, NOT globally for the entire Docker image

Why? I mean, where is pip actually used, in Jenkinsfile as a command or in Dockerfile as a command (to install Something, Something, Something, Dark Side)?

It is used in Kiso-Testing, not Kiso. They share the same Dockerfile.