Closed vivanov19 closed 3 years ago
From your first paragraph it's pretty clear that you have the server running successfully on port 8000, and the command line working too. The front-end on port 8080 come from the web-ui which you're having trouble with.
The command NODE_ENV=development nodemon server.js
being run isn't going to work directly under Windows as 1) it's attempting to set an environment variable in the command line and 2) nodemon is unlikely to be on the path. You should be able to do the equivalent by running set NODE_ENV=development
and then node_modules\.bin\nodemon.cmd server.js
. That alone isn't enough to get the web-ui running for me, so I suspect more changes are needed to get up and running directly under Windows.
For what it's worth, I routinely build and run Zally under Windows 10 but using Windows Subsystem for Linux (Ubuntu 18.04 specifically) and can strongly recommend that approach. Alternatively, if you have Docker for Windows installed then you might want to try out https://github.com/zalando/zally/pull/917, although I haven't got round to testing it yet.
Hi Rob,
First of all, Rob thank you very much for the rapid and detailed reply.
With regards running Zally natively on Windows 10 as you suspected your direction is a starting point, but not a full solution. It is mounting UI on the port 3000 and still stalls:
C:\Enterprise2019\zally-master\web-ui>node_modules.bin\nodemon.cmd server.js
[nodemon] 1.12.7
[nodemon] to restart at any time, enter rs
[nodemon] watching: C:\Enterprise2019\zally-master\web-ui\src\server/*/ ./server.*/
[nodemon] starting node server.js
zally-web-ui mounted on "/"
zally-web-ui running at http://localhost:3000
Therefore, I've tried the #917 suggestion (one big image with all artifacts as discussed in the #917 ticket). The reason I've picked up it vs. your routine approach with Linux / Ubuntu (on Windows on elsewhere I believe) is our company approach to use containers (Docker & k8s) as much as possible. So, it seems I've successfully created the image (Linux Docker container on Windows), push it the Docker hub and even run it on Windows 10. There are definitely some severe warnings in the logging. Please see two attached DOS shell outputs: image creation and Linux image run on Windows. Assuming (from the code analysis) that the front-end call is just http://localhost:8080/ I still have no Zally UI running on it.
It seems the last resort is to "run Zally under Windows 10 but using Windows Subsystem for Linux (Ubuntu 18.04 specifically) and can strongly recommend that approach". Would you please elaborate a bit on the approach. I am out of the city / business for a week starting tomorrow, but really appreciate any further comments on the topics and will explore them on my return.
Thank you very much in advance.
Thanks, VLADIMIR IVANOV, PhD Principal Architect, Integration Advanced Research, Patterns and Practices, and Innovation
[FINASTRA]
Finastra 55 Standish Court, Floor 3, Mississauga, Ontario, L5R 4A1, Canada D: +00 (1)905 267 5000 | M: +00 (1)647 6259 336 | E: vladimir.ivanov@finastra.commailto:vladimir.ivanov@finastra.com Finastra.comhttp://www.finastra.com/
"FINASTRA" is the trade name of the FINASTRA group of companies. This email and any attachments have been scanned for known viruses using multiple scanners. This email message is intended for the named recipient only. It may be privileged and/or confidential. If you are not the named recipient of this email please notify us immediately and do not copy it or use it for any purpose, nor disclose its contents to any other person. This email does not constitute the commencement of legal relations between you and FINASTRA. Please refer to the executed contract between you and the relevant member of the FINASTRA group for the identity of the contracting party with which you are dealing.
From: Rob Oxspring notifications@github.com Sent: Friday, January 18, 2019 6:07 PM To: zalando/zally zally@noreply.github.com Cc: vivanov19 vladimir.ivanov@dhltd.com; Author author@noreply.github.com Subject: Re: [zalando/zally] Local zally Windows installation doesn't work (#919)
CAUTION: This email originated from an external source. If you suspect a potential phishing email, report it to report.incident@finastra.commailto:report.incident@finastra.com
From your first paragraph it's pretty clear that you have the server running successfully on port 8000, and the command line working too. The front-end on port 8080 come from the web-ui which you're having trouble with.
The command NODE_ENV=development nodemon server.js being run isn't going to work directly under Windows as 1) it's attempting to set an environment variable in the command line and 2) nodemon is unlikely to be on the path. You should be able to do the equivalent by running set NODE_ENV=development and then node_modules.bin\nodemon.cmd server.js. That alone isn't enough to get the web-ui running for me, so I suspect more changes are needed to get up and running directly under Windows.
For what it's worth, I routinely build and run Zally under Windows 10 but using Windows Subsystem for Linux (Ubuntu 18.04 specifically) and can strongly recommend that approach. Alternatively, if you have Docker for Windows installed then you might want to try out #917https://github.com/zalando/zally/pull/917, although I haven't got round to testing it yet.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/zalando/zally/issues/919#issuecomment-455716515, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARmJjeDpP-8RAvtxbUd5casfFOj_VA6dks5vElOTgaJpZM4aIY3x.
"FINASTRA" is the trade name of the FINASTRA group of companies. This email and any attachments have been scanned for known viruses using multiple scanners. This email message is intended for the named recipient only. It may be privileged and/or confidential. If you are not the named recipient of this email please notify us immediately and do not copy it or use it for any purpose, nor disclose its contents to any other person. This email does not constitute the commencement of legal relations between you and FINASTRA. Please refer to the executed contract between you and the relevant member of the FINASTRA group for the identity of the contracting party with which you are dealing.
Your environment has been set up for using Node.js 8.9.3 (x64) and npm.
C:\Users\vi3423>cd ../../
C:>cd enterprise2019
C:\Enterprise2019>dir Volume in drive C is System Volume Serial Number is 5A93-A356
Directory of C:\Enterprise2019
01/21/2019 01:08 PM
C:\Enterprise2019>cd zally-master
C:\Enterprise2019\zally-master>dir Volume in drive C is System Volume Serial Number is 5A93-A356
Directory of C:\Enterprise2019\zally-master
01/09/2019 08:59 AM
C:\Enterprise2019\zally-master>cd web-ui
C:\Enterprise2019\zally-master\web-ui>dir Volume in drive C is System Volume Serial Number is 5A93-A356
Directory of C:\Enterprise2019\zally-master\web-ui
01/21/2019 03:03 PM
C:\Enterprise2019\zally-master\web-ui>dockerfile --help 'dockerfile' is not recognized as an internal or external command, operable program or batch file.
C:\Enterprise2019\zally-master\web-ui>dir Volume in drive C is System Volume Serial Number is 5A93-A356
Directory of C:\Enterprise2019\zally-master\web-ui
01/21/2019 03:03 PM
C:\Enterprise2019\zally-master\web-ui>dockerfile 'dockerfile' is not recognized as an internal or external command, operable program or batch file.
C:\Enterprise2019\zally-master\web-ui>docker --help
Usage: docker [OPTIONS] COMMAND
A self-sufficient runtime for containers
Options: --config string Location of client config files (default "C:\Users\vi3423\.docker") -D, --debug Enable debug mode -H, --host list Daemon socket(s) to connect to -l, --log-level string Set the logging level ("debug"|"info"|"warn"|"error"|"fatal") (default "info") --tls Use TLS; implied by --tlsverify --tlscacert string Trust certs signed only by this CA (default "C:\Users\vi3423\.docker\ca.pem") --tlscert string Path to TLS certificate file (default "C:\Users\vi3423\.docker\cert.pem") --tlskey string Path to TLS key file (default "C:\Users\vi3423\.docker\key.pem") --tlsverify Use TLS and verify the remote -v, --version Print version information and quit
Management Commands: builder Manage builds config Manage Docker configs container Manage containers image Manage images network Manage networks node Manage Swarm nodes plugin Manage plugins secret Manage Docker secrets service Manage services stack Manage Docker stacks swarm Manage Swarm system Manage Docker trust Manage trust on Docker images volume Manage volumes
Commands: attach Attach local standard input, output, and error streams to a running container build Build an image from a Dockerfile commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container diff Inspect changes to files or directories on a container's filesystem events Get real time events from the server exec Run a command in a running container export Export a container's filesystem as a tar archive history Show the history of an image images List images import Import the contents from a tarball to create a filesystem image info Display system-wide information inspect Return low-level information on Docker objects kill Kill one or more running containers load Load an image from a tar archive or STDIN login Log in to a Docker registry logout Log out from a Docker registry logs Fetch the logs of a container pause Pause all processes within one or more containers port List port mappings or a specific mapping for the container ps List containers pull Pull an image or a repository from a registry push Push an image or a repository to a registry rename Rename a container restart Restart one or more containers rm Remove one or more containers rmi Remove one or more images run Run a command in a new container save Save one or more images to a tar archive (streamed to STDOUT by default) search Search the Docker Hub for images start Start one or more stopped containers stats Display a live stream of container(s) resource usage statistics stop Stop one or more running containers tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE top Display the running processes of a container unpause Unpause all processes within one or more containers update Update configuration of one or more containers version Show the Docker version information wait Block until one or more containers stop, then print their exit codes
Run 'docker COMMAND --help' for more information on a command.
C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui>docker build -f C:\Enterprise2019\zally-master\web-ui\Dockerfile -t zally/webui "docker build" requires exactly 1 argument. See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
C:\Enterprise2019\zally-master\web-ui>docker build -f C:\Enterprise2019\zally-master\web-ui\Dockerfile "docker build" requires exactly 1 argument. See 'docker build --help'.
Usage: docker build [OPTIONS] PATH | URL | -
Build an image from a Dockerfile
C:\Enterprise2019\zally-master\web-ui>docker build -f C:\Enterprise2019\zally-master\web-ui\Dockerfile . Sending build context to Docker daemon 249.7MB Step 1/14 : FROM registry.opensource.zalan.do/stups/node:8.8.0-alpine-33 as yarn-image 8.8.0-alpine-33: Pulling from stups/node 660c48dd555d: Pull complete 4c7380416e78: Pull complete 421e436b5f80: Pull complete e4ce6c3651b3: Pull complete be588e74bd34: Pull complete 5778a0b7aa1a: Pull complete adf6ea68eb01: Pull complete Digest: sha256:f2799ed41c9ced71619598ea5c3161bdbabadee2f8a3d37edab22b5b6a3506a1 Status: Downloaded newer image for registry.opensource.zalan.do/stups/node:8.8.0-alpine-33 ---> 4e36cb5807f8 Step 2/14 : WORKDIR /home/ ---> Running in 70b9e27f7eff Removing intermediate container 70b9e27f7eff ---> 39ab3afeaef2 Step 3/14 : RUN npm install -g yarn ---> Running in c56e1dcc4ac9 npm info it worked if it ends with ok npm info using npm@5.4.2 npm info using node@v8.8.0 npm http fetch GET 200 https://registry.npmjs.org/yarn 157ms npm http fetch GET 200 https://registry.npmjs.org/yarn/-/yarn-1.13.0.tgz 157ms npm info lifecycle yarn@1.13.0~preinstall: yarn@1.13.0 npm info linkStuff yarn@1.13.0 /usr/local/bin/yarn -> /usr/local/lib/node_modules/yarn/bin/yarn.js /usr/local/bin/yarnpkg -> /usr/local/lib/node_modules/yarn/bin/yarn.js npm info lifecycle yarn@1.13.0~install: yarn@1.13.0 npm info lifecycle yarn@1.13.0~postinstall: yarn@1.13.0
C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui>docker pull --platform=linux ubuntu "--platform" is only supported on a Docker daemon with experimental features enabled
C:\Enterprise2019\zally-master\web-ui>docker run --platform=linux -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done" "--platform" is only supported on a Docker daemon with experimental features enabled
C:\Enterprise2019\zally-master\web-ui>docker run -d vivanov19/zally:webui ping -t 127.0.0.1 2bcd84ccccde3a8e8841598d47cb8746ac22ac7155c88fa69f5ede1b40104c3b docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"ping\": executable file not found in $PATH": unknown.
C:\Enterprise2019\zally-master\web-ui>docker run -d vivanov19/zally:webui 862d73ca4964e1c1165c20a6792786313a2fd1e0a5e35aab6e13a063fc19160c
C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui>docker inspect --format '{{.Os}}' ubuntu
Error: No such object: ubuntu
C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui> C:\Enterprise2019\zally-master\web-ui>docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 862d73ca4964 vivanov19/zally:webui "node server.js" About a minute ago Up About a minute 3000/tcp boring_hertz 2bcd84ccccde vivanov19/zally:webui "ping -t 127.0.0.1" 2 minutes ago Created 3000/tcp optimistic_leakey 93022d4faf40 webui "/bin/bash" 17 hours ago Exited (255) 4 hours ago 3000/tcp zen_nash 6fdd41652e78 webui "cmd.exe" 18 hours ago Created 3000/tcp silly_goldberg 2b1463cc6ac0 3f41c4bbb0a9 "cmd.exe" 18 hours ago Created 3000/tcp gifted_chandrasekhar
First of all, Rob thank you very much for the rapid and detailed reply.
With regards running Zally natively on Windows 10 as you suspected your direction is a starting point, but not a full solution. It is mounting UI on the port 3000 and still stalls:
C:\Enterprise2019\zally-master\web-ui>node_modules.bin\nodemon.cmd server.js
[nodemon] 1.12.7
[nodemon] to restart at any time, enter rs
[nodemon] watching: C:\Enterprise2019\zally-master\web-ui\src\server/*/ ./server.*/
[nodemon] starting node server.js
zally-web-ui mounted on "/"
zally-web-ui running at http://localhost:3000
Therefore, I've tried the #917 suggestion (one big image with all artifacts as discussed in the #917 ticket). The reason I've picked up it vs. your routine approach with Linux / Ubuntu (on Windows on elsewhere I believe) is our company approach to use containers (Docker & k8s) as much as possible. So, it seems I've successfully created the image (Linux Docker container on Windows), push it the Docker hub and even run it on Windows 10. There are definitely some severe warnings in the logging. Please see two attached DOS shell outputs: image creation and Linux image run on Windows. Assuming (from the code analysis) that the front-end call is just http://localhost:8080/ I still have no Zally UI running on it.
It seems the last resort is to "run Zally under Windows 10 but using Windows Subsystem for Linux (Ubuntu 18.04 specifically) and can strongly recommend that approach". Would you please elaborate a bit on the approach. I am out of the city / business for a week starting tomorrow, but really appreciate any further comments on the topics and will explore them on my return.
Thank you very much in advance
I'll detail using WSL separately but one thought following your final docker ps
output - it appears that you have multiple docker containers attempting to use port 3000 which isn't likely to work out well. I recommend docker kill <containerid>
to each of the containers until none are running, then start afresh with your docker run
commands.
@vivanov19 Did it work out for you?
Sorry for the delay with the reply; I had a few business trips. I've rebuild both paths from scratch and this is where I am staying (Windows 10).
Follow Rob's recommendation for UI module I can start it: C:\Enterprise2019\zally-master\web-ui>node_modules.bin\nodemon.cmd server.js [nodemon] 1.12.7 [nodemon] to restart at any time, enter rs [nodemon] watching: C:\Enterprise2019\zally-master\web-ui\src\server// ./server./ [nodemon] starting node server.js zally-web-ui mounted on "/" zally-web-ui running at http://localhost:3000 .... and even get "Zally API Linter WEB UI" label and image in my browser, but with blank, empty page. It looks UI service running in some extend.
Container approach follow #917 (Docker again is running on Windows 10). On Windows 10 I can run both Linux and Windows containers. For Linux mode: 2a. I can successfully create and run image: Step 14/14 : CMD ["node", "server.js"] ---> Using cache ---> 3f41c4bbb0a9 Successfully built 3f41c4bbb0a9 SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
C:\Enterprise2019\zally-master\web-ui>docker run -it 3f41c4bbb0a9 zally-web-ui mounted on "/" zally-web-ui running at http://localhost:3000
I can't invoke anything on port 3000 probably because of this warning. I made sure I have only one container running on port 3000:
2b. When I switched to the Docker Windows container I just failed to create an image:
Sending build context to Docker daemon 249.7MB Step 1/14 : FROM registry.opensource.zalan.do/stups/node:8.8.0-alpine-33 as yarn-image 8.8.0-alpine-33: Pulling from stups/node image operating system "linux" cannot be used on this platform
As I said, at the begging the backend server is running and we can successfully Utilize the "zally --linter-service "http://localhost:8000" --format pretty lint *.yaml", but to have UI running is definitely the ultimate goal to make the framework as the company standard.
Any help would be highly appreciated. Thank you very much, Vlad
I don't have experience running Zally under Windows (and also don't have a Windows machine to reproduce).
But maybe I can bring you one step further: Do docker run -it -p 3000:3000 3f41c4bbb0a9
instead of docker run -it 3f41c4bbb0a9
to start Zally Web UI Docker container. It publishes containers internal port (3000
) to the host (maps to 3000
).
These are tested notes based on my setup, happy to move them into a markdown document in the project if that helps...
The following notes document my working environment for building and testing a full Zally installation from a Windows 10 workstation.
Download and install Docker for Windows
Open Microsoft Store
Search for linux
Install Debian (or Ubuntu, other linuxes may need different commands for package management)
Launch the Debian console
In the Debian console:
Install some general prerequisites
sudo apt-get update -y && sudo apt-get install -y git openjdk-8-jdk curl make g++
(I was quite surprised to see that make
and g++
were necessary to build some dependency of the web-ui)
Install NodeJS
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt-get install -y nodejs
Make Windows docker binaries available on linux path:
sudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker.exe /usr/local/bin/docker
sudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker-compose.exe /usr/local/bin/docker-compose
sudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker-machine.exe /usr/local/bin/docker-machine
sudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker-credential-wincred.exe /usr/local/bin/docker-credential-wincred
Clone Zally into a folder easily addressable under Windows (C:\Zally)
cd /mnt/c
git clone https://github.com/zalando/zally
cd zally
Run the following script to build and then run the services under docker:
./build-and-run.sh
It'll take a while but eventually you'll see something like the following to indicate that we're ready to connect:
Started ApplicationKt in 36.576 seconds (JVM running for 40.144)
Use a browser to check that things are working correctly:
Variations on the following error messages are a regular occurrence when building the web-ui under Windows. The command in question can typically be rerun without producing exactly the same occurrence, so incrementally the command gets further each run. (Producing this guide took 5x attempts at the web-ui build before a full run completed).
error An unexpected error occurred: "ENOENT: no such file or directory, copyfile '/home/username/.cache/yarn/v1/npm-react-ace-5.8.0-872d9ee8b664300ed5ab9edac6234bbe90836836/webpack.config.base.js' -> '/mnt/c/zally/web-ui/node_modules/react-ace/webpack.config.base.js'".
Let's add this page to the docs.
A few further thoughts that occurred to me while checking the WSL notes above:
build-and-run.sh
forces a full "clean" rebuild of the server. Is there any reason for this? The fact that a clean build has to rerun all tests combined with the fact that the initial yarn build often fails the first 4 runs makes this particularly painful.
I wonder if we're confusing matters by having the web-ui talk about port 3000 but then map 8080 -> 3000 during docker-compose.
@vivanov19 in addition to @maxim-tschumak's point above, have you confirmed that you have no other servers running on port 3000 or 8080?
build-and-run.sh
forces a full "clean" rebuild of the server. Is there any reason for this?
Not really, I always prefer a clean build. We can exclude the tests to speed up the process.
Not really, I always prefer a clean build. We can exclude the tests to speed up the process.
Opened #933 to do incremental build - suggest any further discussion happens there and this issue can remain Windows focused.
Thank you very much, Rob and Maxim. It is much better understanding now how the framework's components should be integrated.
Thank you very much for the extremely helpful comments.
No additional actions are required.
Hello,
I followed the README documents and related issues and almost installed zally locally on the Windows 10 machine. I am able to execute all gradlew tasks, but when I am executing the bootRun it stops after initiating the back-end server 0% as script indicated). Back-end (localhost:8000) for sure works since the command
zally --linter-service "http://localhost:8000" --format pretty lint no_must_violations.yaml
brings the meaningful results. I can also get the list of the rules from the browser executing http://localhost:8000/supported-rules as well as all 200+ tests executed successfully. Attached is the complete output from my DOS shell.On the other hand, it never brings front-end running on 8080 port. I am guessing it might be some proxy setting between zally back-end and front-end need to be done, but not sure.
I also successfully mounted / build the web-ui component separately with zally server running in its current state. Again all build tasks are complete successfully with npm and / or yarn, but I can run neither dev nor production builds. Both brings similar exceptions ''NODE_ENV' is not recognized as an internal or external command,'. DEV mode also brings some JS exception. Again, the whole output from another DOS shell is attached.
Please let me know if any other information needed.
FullZallyDOSShellOutput.txt
WebUIZallyDOSShellOutput.txt