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

PR #8

Open
ghost opened this issue Mar 10, 2021 · 7 comments
Open

PR #8

ghost opened this issue Mar 10, 2021 · 7 comments

Comments

@ghost
Copy link

ghost commented Mar 10, 2021

I would like to make PR, to open up the .m2 home path for configuration.

Are you accepting PRs or is it in maintenance mode? 😊

baseLocation = '/home';

this I would like to override with /github/home, does it even make sense?

@stCarolas
Copy link
Owner

It's almost ok for me, but I think better to use $HOME or $USER/home or another way to detect home folder for current user without hardcoding user or entire path. Although I have not checked existence of $ HOME or $ USER variables in github environments.

@mambax
Copy link

mambax commented Mar 11, 2021

I did some experiments yesterday and there is some stuff that is shared.
The containers can not access outside the volumes logically, so the m2 would need to be in a folder which is mounted by default to the containers.
These are:

-v "/var/run/docker.sock":"/var/run/docker.sock" 
-v "/home/runners/actions-runner/_work/_temp/_github_home":"/github/home" 
-v "/home/runners/actions-runner/_work/_temp/_github_workflow":"/github/workflow" 
-v "/home/runners/actions-runner/_work/_temp/_runner_file_commands":"/github/file_commands" 
-v "/home/runners/actions-runner/_work/basa-action-runner-test/basa-action-runner-test":"/github/workspace"

From all them I see only workspace as candidate because the others are "temp" and I think they are just created on the fly maybe even per step and also quite hacky.

So if we could have workspace/.m2 that would be prime!

As I am no maven expert I dunno if this is applicable. But it would also open the possibility to push a settings.xml in it!

On a second note, this might make no sense as the workspace assumingly exists per workspace not per "runner".

Hmmm, how can one level1 cache maven on a runner?

@mambax
Copy link

mambax commented Mar 12, 2021

@stCarolas we can also do in your action.yml:

inputs:
  ...
  maven-home-dir:
    default: '$HOME'
    description: 'Where should the MAVEN_HOME be set to'

with examples:

inputs:
  ...
  maven-home-dir:
    default: '/github/workspace'
    description: 'Where should the MAVEN_HOME be set to'

This example would make the m2 folder available for docker actions!

@stCarolas
Copy link
Owner

@mambax parameter in action.yml is good for me. Also I would prefer default value as in setup-java - so another actions will use same maven home by default.

@ghost
Copy link
Author

ghost commented Mar 15, 2021

I got in touch with GHES Support. I provided them a demo
https://github.com/dominikmeyersap/actions-maven-demo/actions/runs/653849332

Now in there you see:
Output of runner: /home/runner/.m2/repository
Output of container action: /root/.m2/repository

I did not find a suitable solution yet as there is now way currently to handle volumes to docker actions (Except using container option which is something completely different :D )

@stCarolas
Copy link
Owner

@dominikmeyersap what the point of running maven on agent and maven in docker simultaneously? Is the problem in mounting maven cache to container ?

@ghost
Copy link
Author

ghost commented Mar 17, 2021

Is the problem in mounting maven cache to container?

Correct 💯
We want to cache on the runner like Level1 all dependencies. And then the containers can use the runner as L1 cache instead of asking nexus for everything. It will speed up builds by 900% 😄

I have a gut feeling that with GHES 3 (which we get soon) we could use container: my-container and then volume-mount the maven repo into them. But still I'd like to solve it already.

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

No branches or pull requests

2 participants