Closed mariodedapolito closed 1 year ago
I had a quick look at the changes but I must admit it is a little bit overwhelming to review changes in 78 files!
However I assume you already successfully run all the integration and e2e tests, therefore LGTM
@arol-varesi and @mariodedapolito
Tried to run as Docker but result in some errors. Have you had the same problem?
I am testing the PR in a Codespace:
cd Docker
docker compose up --build
Here is an excerpt of the build result:
@gmacario ➜ /workspaces/AROL-CLOUD/Docker (7-fix-bugs-created-from-lint-tickets-modifications) $ docker compose up --build
[+] Running 24/24
✔ mongodb 9 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 32.2s
✔ 99de9192b4af Pull complete 2.9s
✔ 18b9e63943e7 Pull complete 2.1s
✔ ccf1fde52048 Pull complete 2.9s
✔ 8317989437cb Pull complete 3.4s
✔ 1bde6bf8acc1 Pull complete 3.3s
✔ 11fb005be9eb Pull complete 3.6s
✔ 81a254c162fc Pull complete 3.6s
✔ 2a574922bf90 Pull complete 8.1s
✔ 22659e13b0a2 Pull complete 3.9s
✔ postgres 13 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 31.7s
✔ 52d2b7f179e3 Pull complete 0.6s
✔ d9c06b35c8a5 Pull complete 0.3s
✔ ec0d4c36c7f4 Pull complete 0.4s
✔ aa8e32a16a69 Pull complete 0.7s
✔ 8950a67e90d4 Pull complete 0.8s
✔ 1b47429b7c5f Pull complete 1.0s
✔ a773f7da97bb Pull complete 1.0s
✔ 7bddc9bbcf13 Pull complete 1.1s
✔ 60829730fa39 Pull complete 3.3s
✔ f3d9c845d2f3 Pull complete 1.3s
✔ cfcd43fe346d Pull complete 1.4s
✔ 576335d55cdb Pull complete 1.6s
✔ caad4144446c Pull complete 1.7s
[+] Building 283.3s (26/27) docker:default
=> [express-server internal] load build definition from Dockerfile 0.6s
=> => transferring dockerfile: 681B 0.0s
...
=> [react-client builder 3/5] COPY . /client 0.5s
=> [react-client builder 4/5] RUN npm install --force 86.9s
=> ERROR [react-client builder 5/5] RUN npm run build 82.2s
------
> [react-client builder 5/5] RUN npm run build:
3.597
3.597 > react-client@0.1.0 build /client
3.597 > react-scripts build
3.597
11.80 Creating an optimized production build...
18.69 One of your dependencies, babel-preset-react-app, is importing the
18.69 "@babel/plugin-proposal-private-property-in-object" package without
18.69 declaring it in its dependencies. This is currently working because
18.69 "@babel/plugin-proposal-private-property-in-object" is already in your
18.69 node_modules folder for unrelated reasons, but it may break at any time.
18.69
18.69 babel-preset-react-app is part of the create-react-app project, which
18.69 is not maintianed anymore. It is thus unlikely that this bug will
18.69 ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
18.69 your devDependencies to work around this error. This will make this message
18.69 go away.
18.69
81.30 The build failed because the process exited too early. Someone might have called `kill` or `killall`, or the system could be shutting down.
81.42 npm ERR! code ELIFECYCLE
81.42 npm ERR! errno 1
81.42 npm ERR! react-client@0.1.0 build: `react-scripts build`
81.42 npm ERR! Exit status 1
81.42 npm ERR!
81.42 npm ERR! Failed at the react-client@0.1.0 build script.
81.42 npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
81.45
81.45 npm ERR! A complete log of this run can be found in:
81.45 npm ERR! /root/.npm/_logs/2023-08-24T08_45_38_757Z-debug.log
------
failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 1
@gmacario ➜ /workspaces/AROL-CLOUD/Docker (7-fix-bugs-created-from-lint-tickets-modifications) $
So it looks like there are some little problems on building the react-client.
I wonder whether this is already tracked in #8
I suggest to use Codespaces as the official testbench since at least we have the same versions for node, npm, etc.
On it, I do agree with codespaces since on my machine everything is running as intended.
@gmacario @arol-varesi
@arol-varesi done, thank you.
Still investigating as the issue is now restricted only to Codespaces (tried both on mac and windows machine and it succeeds).
@arol-varesi done, thank you.
Still investigating as the issue is now restricted only to Codespaces (tried both on mac and windows machine and it succeeds).
I would personally compare the results to the following programs on both failing and succeeding hosts to see whether we can find a pattern:
uname -a
lsb_release -a
node --version
npm --version
npm list
Thank you for the valuable tip @gmacario. Will report if I find a fix or find a pattern.
@gmacario @arol-varesi the docker problem we were experiencing was related to codespaces. After researching the issue my conclusion is that the process was terminating due to insufficient memory or due to codespaces-imposed timeouts.
In order to test the docker container, I added a github action that does just that, so this check is now part of the pipeline. I also replaced the npm install
with npm ci
which is meant to be used in automated environments. I also updated the node versions in both FE and BE docker containers. During these changes I also managed to fix the --force
flag which was needed when npm install
the project FE (react). Also upgraded react-scripts
to v5.0.1 which includes much more modern SSL support.
Github action run: https://github.com/arol-polito/AROL-CLOUD/actions/runs/5993565075
@arol-varesi tried on my mac and on windows and everything is working correctly for me. probably that port is already occupied on your machine and it fails because of that. this was also happening to some SDP project groups when we were using 27017 also for Docker, so that is why i changed it to 57017.
@arol-varesi tried on my mac and on windows and everything is working correctly for me. probably that port is already occupied on your machine and it fails because of that. this was also happening to some SDP project groups when we were using 27017 also for Docker, so that is why i changed it to 57017.
Very good so I can approve this PR.
Thank you @arol-varesi! Merging now to main.