I'm trying to get started with Spryker with the Bo...
# docker
f
I'm trying to get started with Spryker with the Bootcamp but got stuck in the docker build process with npm. I have Windows with WSL (Ubuntu 18.04). When building the docker images the npm install fails due to missing python. To isolate the issue:
Copy code
$ docker/sdk cli npm install
Warning: Neither SSH agent or COMPOSER_AUTH is configured. Private repositories would not be accessible.

> node-sass@4.10.0 install /data/node_modules/@spryker/oryx-for-zed/node_modules/node-sass
> node scripts/install.js

Downloading binary from <https://github.com/sass/node-sass/releases/download/v4.10.0/linux_musl-x64-72_binding.node>
Cannot download "<https://github.com/sass/node-sass/releases/download/v4.10.0/linux_musl-x64-72_binding.node>":

HTTP error 404 Not Found

Hint: If <http://github.com|github.com> is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=<http://example.com:1234>

or configure npm proxy via

      npm config set proxy <http://example.com:8080>

> node-sass@4.10.0 postinstall /data/node_modules/@spryker/oryx-for-zed/node_modules/node-sass
> node scripts/build.js

Building: /usr/bin/node /data/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   '/usr/bin/node',
gyp verb cli   '/data/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli   'rebuild',
gyp verb cli   '--verbose',
gyp verb cli   '--libsass_ext=',
gyp verb cli   '--libsass_cflags=',
gyp verb cli   '--libsass_ldflags=',
gyp verb cli   '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@12.18.4 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/data/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/data/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/data/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /data/node_modules/which/which.js:89:16
gyp verb `which` failed     at /data/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /data/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21)
gyp verb `which` failed  python2 Error: not found: python2
gyp verb `which` failed     at getNotFoundError (/data/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/data/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/data/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /data/node_modules/which/which.js:89:16
gyp verb `which` failed     at /data/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /data/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` failed Error: not found: python
gyp verb `which` failed     at getNotFoundError (/data/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/data/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/data/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /data/node_modules/which/which.js:89:16
gyp verb `which` failed     at /data/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /data/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21)
gyp verb `which` failed  python Error: not found: python
gyp verb `which` failed     at getNotFoundError (/data/node_modules/which/which.js:13:12)
gyp verb `which` failed     at F (/data/node_modules/which/which.js:68:19)
gyp verb `which` failed     at E (/data/node_modules/which/which.js:80:29)
gyp verb `which` failed     at /data/node_modules/which/which.js:89:16
gyp verb `which` failed     at /data/node_modules/isexe/index.js:42:5
gyp verb `which` failed     at /data/node_modules/isexe/mode.js:8:5
gyp verb `which` failed     at FSReqCallback.oncomplete (fs.js:168:21) {
gyp verb `which` failed   code: 'ENOENT'
gyp verb `which` failed }
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (/data/node_modules/node-gyp/lib/configure.js:484:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/data/node_modules/node-gyp/lib/configure.js:406:16)
gyp ERR! stack     at F (/data/node_modules/which/which.js:68:16)
gyp ERR! stack     at E (/data/node_modules/which/which.js:80:29)
gyp ERR! stack     at /data/node_modules/which/which.js:89:16
gyp ERR! stack     at /data/node_modules/isexe/index.js:42:5
gyp ERR! stack     at /data/node_modules/isexe/mode.js:8:5
gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:168:21)
gyp ERR! System Linux 4.19.76-linuxkit
gyp ERR! command "/usr/bin/node" "/data/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /data/node_modules/@spryker/oryx-for-zed/node_modules/node-sass
gyp ERR! node -v v12.18.4
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN typescript-eslint-parser@22.0.0 requires a peer of eslint@>=4.19.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.10.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.10.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/spryker/.npm/_logs/2020-09-30T06_57_53_268Z-debug.log
h
Please, use latest B2C demoshop OR adjust deploy.yml you use according the following:
Copy code
image:
  tag: spryker/php:7.3-alpine3.10
It is incompatibility of some npm modules with alpine 3.12.
f
Thanks that works. But not for too long. A docker command seems to fail and afterwards unison:
Copy code
ok  Starting unison for sync spryker_b2c_dev_dev_data_sync
          ok  spryker_b2c_dev_dev_data_sync container not running
          ok  Starting precopy
     precopy  docker run --rm -v "spryker_b2c_dev_dev_data_sync:/app_sync" -e APP_VOLUME=/app_sync -e TZ=$(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`) -e UNISON_SRC="-socket 5000" -e UNISON_DEST="/app_sync" -e MONIT_ENABLE="false" -e MONIT_INTERVAL="" -e MONIT_HIGH_CPU_CYCLES="" -e UNISON_ARGS="-ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm'" -e UNISON_WATCH_ARGS="" -e OWNER_UID="1000" -e HOSTSYNC_ENABLE="0" -e UNISONSOCKET_ENABLE="1"  --name spryker_b2c_dev_dev_data_sync eugenmayer/unison:2.51.2.2 /usr/local/bin/precopy_appsync
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
doing initial sync with unison
Unison 2.51.2 (ocaml 4.08.1): Contacting server...
Looking for changes
Reconciling changes
Propagating updates
UNISON 2.51.2 (OCAML 4.08.1) started propagating changes at 11:51:04.47 on 30 Sep 2020
[BGN] Copying  from /app_sync to /host_sync
[END] Copying
UNISON 2.51.2 (OCAML 4.08.1) finished propagating changes at 11:51:04.47 on 30 Sep 2020
Saving synchronizer state
Synchronization complete at 11:51:04  (1 item transferred, 0 skipped, 0 failed)
real    0m 0.30s
user    0m 0.10s
sys     0m 0.03s
chown ing file to uid 1000
          ok  creating spryker_b2c_dev_dev_data_sync container
     command  docker run -p '127.0.0.1::5000' -v spryker_b2c_dev_dev_data_sync:/app_sync -e APP_VOLUME=/app_sync -e TZ=$(basename $(dirname `readlink /etc/localtime`))/$(basename `readlink /etc/localtime`) -e UNISON_SRC="-socket 5000" -e UNISON_DEST="/app_sync" -e MONIT_ENABLE="false" -e MONIT_INTERVAL="" -e MONIT_HIGH_CPU_CYCLES="" -e UNISON_ARGS="-ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm'" -e UNISON_WATCH_ARGS="" -e OWNER_UID="1000" -e HOSTSYNC_ENABLE="0" -e UNISONSOCKET_ENABLE="1"  --name spryker_b2c_dev_dev_data_sync -d eugenmayer/unison:2.51.2.2
dirname: missing operand
Try 'dirname --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
basename: missing operand
Try 'basename --help' for more information.
          ok  starting initial sync of spryker_b2c_dev_dev_data_sync
     command  docker inspect --format='{{(index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort}}' spryker_b2c_dev_dev_data_sync
     command  unison -testserver /app_sync "<socket://127.0.0.1:32773>"
     command  docker inspect --format='{{(index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort}}' spryker_b2c_dev_dev_data_sync
     command  unison -ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm' '/c/dev/spryker/b2c-demo-shop' -auto -batch -prefer '/c/dev/spryker/b2c-demo-shop' -copyonconflict -force newer -perms=0 <socket://127.0.0.1:32773>
       error  Error starting sync, exit code 0
     message  Warning: No archive files were found for these roots, whose canonical names are:
        /c/dev/spryker/b2c-demo-shop
        //38584cb85bda//app_sync
This can happen either
because this is the first time you have synchronized these roots,
or because you have upgraded Unison to a new version with a different
archive format.

Update detection may take a while on this run if the replicas are
large.

Unison will assume that the 'last synchronized state' of both replicas
was completely empty.  This means that any files that are different
will be reported as conflicts, and any files that exist only on one
replica will be judged as new and propagated to the other replica.
If the two replicas are identical, then no changes will be reported.

If you see this message repeatedly, it may be because one of your machines
is getting its address from DHCP, which is causing its host name to change
between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME
environment variable for advice on how to correct this.

Donations to the Unison project are gratefully accepted:
<http://www.cis.upenn.edu/~bcpierce/unison>


     message  Unison 2.51.2 (ocaml 4.06.0): Contacting server...
Connected [//38584cb85bda//app_sync -> //XDP0128//c/dev/spryker/b2c-demo-shop]
Looking for changes
  Waiting for changes from server
Fatal error: Fatal error during unmarshaling (input_value: ill-formed message),
possibly because client and server have been compiled with differentversions of the OCaml compiler.
     success  Unison server started
     command  docker inspect --format='{{(index (index .NetworkSettings.Ports "5000/tcp") 0).HostPort}}' spryker_b2c_dev_dev_data_sync
     command  unison -ignore='Path .git' -ignore='Path docker' -ignore='Path data/*/cache' -ignore='Name .docker-sync' -ignore='Name .idea' -ignore='Name .project' -ignore='Name *.log' -ignore='Name node_modules' -ignore='Name .composer' -ignore='Name .npm' '/c/dev/spryker/b2c-demo-shop' -auto -batch -prefer '/c/dev/spryker/b2c-demo-shop' -copyonconflict -force newer -perms=0 <socket://127.0.0.1:32773>
       error  Error starting sync, exit code 0
     message  Warning: No archive files were found for these roots, whose canonical names are:
        /c/dev/spryker/b2c-demo-shop
        //38584cb85bda//app_sync
This can happen either
because this is the first time you have synchronized these roots,
or because you have upgraded Unison to a new version with a different
archive format.

Update detection may take a while on this run if the replicas are
large.

Unison will assume that the 'last synchronized state' of both replicas
was completely empty.  This means that any files that are different
will be reported as conflicts, and any files that exist only on one
replica will be judged as new and propagated to the other replica.
If the two replicas are identical, then no changes will be reported.

If you see this message repeatedly, it may be because one of your machines
is getting its address from DHCP, which is causing its host name to change
between synchronizations.  See the documentation for the UNISONLOCALHOSTNAME
environment variable for advice on how to correct this.

Donations to the Unison project are gratefully accepted:
<http://www.cis.upenn.edu/~bcpierce/unison>


     message  Unison 2.51.2 (ocaml 4.06.0): Contacting server...
Connected [//38584cb85bda//app_sync -> //XDP0128//c/dev/spryker/b2c-demo-shop]
Looking for changes
  Waiting for changes from server
Fatal error: Fatal error during unmarshaling (input_value: ill-formed message),
possibly because client and server have been compiled with differentversions of the OCaml compiler.
     success  Starting Docker-Sync in the background
Creating network "spryker_b2c_dev_private" with the default driver
Creating network "spryker_b2c_dev_public" with the default driver
Creating volume "spryker_b2c_dev_database-postgres-data" with default driver
Creating volume "spryker_b2c_dev_broker-rabbitmq-data" with default driver
Creating volume "spryker_b2c_dev_session-redis-data" with default driver
Creating volume "spryker_b2c_dev_key_value_store-redis-data" with default driver
Creating volume "spryker_b2c_dev_search-elastic-data" with default driver
Creating volume "spryker_b2c_dev_scheduler-jenkins-data" with default driver
Creating volume "spryker_b2c_dev_mail_catcher-mailhog-data" with default driver
Creating volume "spryker_b2c_dev_swagger-swagger-ui-data" with default driver
Creating volume "spryker_b2c_dev_redis-gui-redis-commander-data" with default driver
Creating volume "spryker_b2c_dev_dashboard-dashboard-data" with default driver
Creating volume "spryker_b2c_dev_ssh-relay" with default driver
Creating volume "spryker_b2c_dev_logs" with default driver
Creating volume "spryker_b2c_dev_cli_history" with default driver
Pulling cli_ssh_relay (bpack/socat:)...
latest: Pulling from bpack/socat
ff3a5c916c92: Pull complete
57b99ab2bf88: Pull complete
Digest: sha256:ceab1a1913803f15d0893d08e657e2bcb12c2a1fec68b67e44a43ebe2c4ab535
Status: Downloaded newer image for bpack/socat:latest
Creating spryker_b2c_dev_cli_1           ... done
Creating spryker_b2c_dev_cli_ssh_relay_1 ... done
chmod: cannot access '/data/config/Zed/*.key': No such file or directory
Composer could not find a composer.json file in /data
To initialize a project, please create a composer.json file as described in the <https://getcomposer.org/> "Getting Started" section
h
Fatal error during unmarshaling
means the version of unison and/or OCAML is different on host and in docker-sync container.
f
I used the one from the tutorial - https://documentation.spryker.com/docs/docker-installation-prerequisites-windows. That's the last stable version as far as I can see from the releases. How can I open a terminal to the docker-sync container to compare the versions?
a
I had the same error back when I was trying with WSL1 and older version of the Windows. Our developers couldn't reproduce it though. I gave up as I haven't found any solution to this problem except switching either to vagrant devvm or update Windows and use WSL2 wihtout docker-sync but working with remote folders from WSL2 in the IDE (VSCode or PHPStorm).
h
I have a solution.
1. Check local versions of Unison and OCAML 2. Build docker-sync images with specific version you have (replace with the correct versions):
Copy code
git clone git@github.com:EugenMayer/docker-image-unison.git /tmp/docker-image-unison
cd /tmp/docker-image-unison
docker build --build-arg "OCAML_VERSION=4.06.0" --build-arg "UNISON_VERSION=2.51.2" -t custom-docker-image-unison .
cd -
rm -rf /tmp/docker-image-unison
3. Change deploy.dev.yml file accordingly:
Copy code
...
docker:
...
  mount:
    docker-sync:
    ...
      image: custom-docker-image-unison
4. Boot + up
Copy code
docker/sdk boot deploy.dev.yml && docker/sdk up
f
sorry - took some time to allow the direct access to alpinelinux.org with ssl. Builing docker-sync image fails:
Copy code
caml-4.06.0/byterun/caml/major_gc.h:68: first defined here
#5 36.25 /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: main.pic.o:/tmp/ocaml-4.06.0/byterun/caml/major_gc.h:67: multiple definition of `caml_major_ring'; interp.pic.o:/tmp/ocaml-4.06.0/byterun/caml/major_gc.h:67: first defined here
#5 36.31 collect2: error: ld returned 1 exit status
#5 36.31 make[1]: *** [Makefile:202: libcamlrun_shared.so] Error 1
#5 36.31 make: *** [Makefile:384: coldstart] Error 2
#5 36.31 make[1]: Leaving directory '/tmp/ocaml-4.06.0/byterun'
------
failed to solve with frontend dockerfile.v0: failed to build LLB: executor failed running [/bin/sh -c apk update     && apk add --no-cache --virtual .build-deps build-base coreutils                                         && wget <http://caml.inria.fr/pub/distrib/ocaml-${OCAML_VERSION:0:4}/ocaml-${OCAML_VERSION}.tar.gz>        && tar xvf ocaml-${OCAML_VERSION}.tar.gz -C /tmp                                                                      && cd /tmp/ocaml-${OCAML_VERSION}     && ./configure     && make world     && make opt     && umask 022     && make install     && make clean     && apk del .build-deps                                                       && rm -rf /tmp/ocaml-${OCAML_VERSION}    && rm /ocaml-${OCAML_VERSION}.tar.gz]: runc did not terminate sucessfully
h
What versions do you build?
f
Exaktly your example OCAML 4.06.0 and Unison 2.51.2 -> both are the ones used in my Ubuntu 18.04 (Windows Subsystem)
h
I tried it and the error seems to be the same. However we do this according the docs: https://github.com/EugenMayer/docker-image-unison
They use OCAML 4.08.1 by default now.
f
I tried to use OCAML 4.08.1 on the Ubunutu instance -> it doesn't compile.
Copy code
File "/home/userxy/unison-2.51.2/src/system.ml", line 1:
Error: The implementation /home/userxy/unison-2.51.2/src/system.ml
       does not match the interface system.cmi:
       Values do not match:
         val link : ?follow:bool -> string -> string -> unit
Should I have just built the docker-sync with the newer ocaml version?
h
Yes. That’s all. However I cannot build it by myself with any variants of versions.
f
Should I try to get the WSL2 to avoid this issue?
h
I doubt it may have difference, OCAML/Unison would be the same. You can try mutagen.io instead. Download and install: https://github.com/mutagen-io/mutagen/releases/tag/v0.12.0-beta2 in deploy.yml
Copy code
mount:
  mutagen:
f
Thanks for your support. I managed to get the tag 202009.0 up and running. As the update to WSL2 is recommended everywhere I updated Windows and use now WSL2. I guess as docker now also uses the WSL2 subsystem there is no incompatibility.
🎉 1