Open NeoEGM opened 3 years ago
I'm having the exact same issue, but with a more recent version of Ubuntu and Docker (respectively 20.04.2 and 20.10.5). Same behaviour on my laptop and in a GitLab pipeline.
I was finding that extra .
in /usr./exakat/config/exakat.ini
suspicious too so I've been digging there a bit and I've found it's probably a dead end: the problem comes from the volume and working directory: I was using /src
too and it's simply this line in \Exakat\Configsource\ExakatConfig::loadConfig()
return str_replace(getcwd(), '.', $configFile);
in that case getcwd()
returns /src
which happens to be in the file's complete path...
Using /code
instead of /src
solves the path issue for /usr/src/exakat/config/exakat.ini
but doesn't fix the main issue:
$ docker run -it --rm -v $(pwd):/code -w /code --entrypoint /usr/src/exakat/exakat exakat/exakat:latest project
Error : This command requires a project name. Pass the -p option, or use .exakat.yaml config file.
Aborting
on file phar:///usr/src/exakat/exakat/library/Exakat/Tasks/Project.php
on line 60
Yes! I found the same replacement and did something similar to you without results either.
I've been digging a while more and found it might have to do with something on the phar architecture itself: not beeing able to change the cwd correctly and, thus, making the file_exists() call not work:
https://stackoverflow.com/a/18442941
The problem, anyway, should be addressed ideally by someone on exakat's team, which would find the main cause pretty quickly I guess!
I resigned since I was spending so much time without results. I also tried to build the Dockerfile, which in turn downloads the same phar file I would download on a real machine with the same results, so I imagine the problem doesn't have to do with that.
I didn't attempt a full installation outside docker. Perhaps the php version used has something to do; I wouldn't know. I just gave up by now.
If you realize something else or get to contact someone from the team please update us here!
El vie., 5 de mar. de 2021 20:28, Sébastien Ballangé < notifications@github.com> escribió:
I'm having the exact same issue, but with a more recent version of Ubuntu and Docker (respectively 20.04.2 and 20.10.5). Same behaviour on my laptop and in a GitLab pipeline.
I was finding that extra . in /usr./exakat/config/exakat.ini suspicious too so I've been digging there a bit and I've found it's probably a dead end: the problem comes from the volume and working directory: I was using /src too and it's simply this line in \Exakat\Configsource\ExakatConfig::loadConfig()
return str_replace(getcwd(), '.', $configFile);
in that case getcwd() returns /src which happens to be in the file's complete path...
Using /code instead of /src solves the path issue for /usr/src/exakat/config/exakat.ini but doesn't fix the main issue:
$ docker run -it --rm -v $(pwd):/code -w /code --entrypoint /usr/src/exakat/exakat exakat/exakat:latest project
Error : This command requires a project name. Pass the -p option, or use .exakat.yaml config file.
Aborting
on file phar:///usr/src/exakat/exakat/library/Exakat/Tasks/Project.php
on line 60
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/exakat/exakat-docker/issues/22#issuecomment-791786981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH73HP5JRQM5SIBPO77GLTTCFSLLANCNFSM4X5FVZVA .
There seems to be a problem with relative paths on Phars, perhaps Exakat not finding the .exakat.yml file is related to that.
Or perhaps using realpath() like here: https://stackoverflow.com/a/20346438
El vie., 5 de mar. de 2021 21:54, Ezequiel Miravalles neoegm@gmail.com escribió:
Yes! I found the same replacement and did something similar to you without results either.
I've been digging a while more and found it might have to do with something on the phar architecture itself: not beeing able to change the cwd correctly and, thus, making the file_exists() call not work:
https://stackoverflow.com/a/18442941
The problem, anyway, should be addressed ideally by someone on exakat's team, which would find the main cause pretty quickly I guess!
I resigned since I was spending so much time without results. I also tried to build the Dockerfile, which in turn downloads the same phar file I would download on a real machine with the same results, so I imagine the problem doesn't have to do with that.
I didn't attempt a full installation outside docker. Perhaps the php version used has something to do; I wouldn't know. I just gave up by now.
If you realize something else or get to contact someone from the team please update us here!
El vie., 5 de mar. de 2021 20:28, Sébastien Ballangé < notifications@github.com> escribió:
I'm having the exact same issue, but with a more recent version of Ubuntu and Docker (respectively 20.04.2 and 20.10.5). Same behaviour on my laptop and in a GitLab pipeline.
I was finding that extra . in /usr./exakat/config/exakat.ini suspicious too so I've been digging there a bit and I've found it's probably a dead end: the problem comes from the volume and working directory: I was using /src too and it's simply this line in \Exakat\Configsource\ExakatConfig::loadConfig()
return str_replace(getcwd(), '.', $configFile);
in that case getcwd() returns /src which happens to be in the file's complete path...
Using /code instead of /src solves the path issue for /usr/src/exakat/config/exakat.ini but doesn't fix the main issue:
$ docker run -it --rm -v $(pwd):/code -w /code --entrypoint /usr/src/exakat/exakat exakat/exakat:latest project
Error : This command requires a project name. Pass the -p option, or use .exakat.yaml config file.
Aborting
on file phar:///usr/src/exakat/exakat/library/Exakat/Tasks/Project.php
on line 60
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/exakat/exakat-docker/issues/22#issuecomment-791786981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH73HP5JRQM5SIBPO77GLTTCFSLLANCNFSM4X5FVZVA .
I'm starting to doubt the in-code version of specifying the project's config actually works :/
I've tried to use Composer to install exakat (from inside the provided Docker container to avoid having to deal with the other dependencies) and I'm getting the same
This command requires a project name. Pass the -p option, or use .exakat.yaml config file.
I get the same result with Exakat installed as global Composer dependency:
$ docker run -it --rm -v $(pwd):/code -w /code exakat/exakat:latest bash
# composer global require exakat/exakat
# php ~/.composer/vendor/bin/exakat project
outside everything in /tmp
:
$ docker run -it --rm -v $(pwd):/code -w /code exakat/exakat:latest bash
# cd /tmp
# composer require exakat/exakat
# cd /code
# php /tmp/vendor/bin/exakat project
or as a dev dependency of my project:
$ docker run -it --rm -v $(pwd):/code -w /code exakat/exakat:latest bash
# cd /code
# composer require --dev exakat/exakat
# php vendor/bin/exakat project
I guess I'll revert to using Exakat outside our CI in a projects/
folder with each project cloned in its own set of folders and I'll script something to run Exakat on all our projects. I might come back later to see if I can either pinpoint the problem or better find a fix, but for now I need to move on.
I couldn't make the projects version with code folder symlinked to work either. I tried the Docker version too because of the dependencies. Tell us if you find something else! Thanks!
El lun., 8 de mar. de 2021 17:22, Sébastien Ballangé < notifications@github.com> escribió:
I'm starting to doubt the in-code version of specifying the project's config actually works :/
I've tried to use Composer to install exakat (from inside the provided Docker container to avoid having to deal with the other dependencies) and I'm getting the same
This command requires a project name. Pass the -p option, or use .exakat.yaml config file.
I get the same result with Exakat installed as global Composer dependency:
$ docker run -it --rm -v $(pwd):/code -w /code exakat/exakat:latest bash
composer global require exakat/exakat
php ~/.composer/vendor/bin/exakat project
outside everything in /tmp:
$ docker run -it --rm -v $(pwd):/code -w /code exakat/exakat:latest bash
cd /tmp
composer require exakat/exakat
cd /code
php /tmp/vendor/bin/exakat project
or as a dev dependency of my project:
$ docker run -it --rm -v $(pwd):/code -w /code exakat/exakat:latest bash
cd /code
composer require --dev exakat/exakat
php vendor/bin/exakat project
I guess I'll revert to using Exakat outside our CI in a projects/ folder with each project cloned in its own set of folders and I'll script something to run Exakat on all our projects. I might come back later to see if I can either pinpoint the problem or better find a fix, but for now I need to move on.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/exakat/exakat-docker/issues/22#issuecomment-793048217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH73HLL23VXXLOFBVP63LDTCUWY5ANCNFSM4X5FVZVA .
Was this ever solved or is this abandoned or something? The same problem is happening sept/22
Using guide:
https://exakat.readthedocs.io/en/stable/Tutorial.html#docker-container-within-the-code-folder
On the code folder, the following command doesn't work:
Nor:
It outputs:
There is a
.exakat.yaml
file on the code dir with the following simple content as recommended in the guide:But it doesn't seem to be detected at all:
returns:
Specially this part:
And this dot in the
exakat.ini
part seems suspicious:It says:
/usr./exakat/config/exakat.ini
.But running the following command, changing the working dir, also changes the path, making it look as ir replaced the working dir with a dot:
Command:
Returns: (notice the multiple dots on
exakat.ini
entry and the lack of the mkdir() error at the beginning).Running on bare metal Linux Ubuntu 18.04.5. Docker version 19.03.6, build 369ce74a3c.
Also tried the projects folder mode (with
-p
and symlinking at the init command (with-R .... -symlink
) without results too, said it couldn't find code, but this in-code-directory setup fits much better my use case).Thanks in advance!!