zalando / zally

A minimalistic, simple-to-use API linter
https://zalando.github.io/zally
MIT License
903 stars 143 forks source link

Local zally Windows installation doesn't work #919

Closed vivanov19 closed 3 years ago

vivanov19 commented 5 years ago

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

roxspring commented 5 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.

vivanov19 commented 5 years ago

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

. 01/21/2019 01:08 PM .. 01/10/2019 04:22 PM AngularSpringDemoProject 01/09/2019 01:07 PM BDD 01/15/2019 02:05 PM Cucumber 01/21/2019 01:08 PM 457 DockerBuildScript.txt 01/14/2019 01:58 PM 21,697 GetCustomizedImage.zip 01/14/2019 01:58 PM 21,766 GetCustomizedImagePAT.zip 01/14/2019 01:58 PM 21,762 GetCustomizedImageQA.zip 01/10/2019 03:10 PM 1,525,470 index2018-02221030-enforcingapidesignrules-180226020748.pdf 01/21/2019 12:31 PM 5,371 ProjectsSetupDetailsUrls.txt 01/07/2019 10:21 AM SpringFoxDemoProject 01/17/2019 10:31 PM tutorials-master 01/09/2019 08:59 AM zally-master 01/15/2019 04:20 PM 5,392,896 zally_1.2.0_windows_64bit.tar 7 File(s) 6,989,419 bytes 8 Dir(s) 343,807,463,424 bytes free

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

. 01/09/2019 08:59 AM .. 01/09/2019 08:59 AM .delivery 01/09/2019 08:59 AM 761 .gitattributes 01/09/2019 08:59 AM .github 01/09/2019 08:59 AM 238 .gitignore 01/09/2019 08:59 AM 2,377 .travis.yml 01/09/2019 08:59 AM 125 .zally.yaml 01/09/2019 08:59 AM 364 .zappr.yaml 01/09/2019 08:59 AM 814 build-and-run.sh 01/09/2019 08:59 AM cli 01/09/2019 08:59 AM 1,276 CONTRIBUTING 01/09/2019 08:59 AM 838 delivery.yaml 01/09/2019 08:59 AM 1,027 docker-compose-bark.yaml 01/09/2019 08:59 AM 832 docker-compose.yaml 01/09/2019 08:59 AM documentation 01/09/2019 08:59 AM examples 01/09/2019 08:59 AM github-integration 01/09/2019 08:59 AM 1,109 LICENSE 01/09/2019 08:59 AM 243,903 logo.png 01/09/2019 08:59 AM 167 MAINTAINERS 01/09/2019 08:59 AM 3,390 README.md 01/09/2019 08:59 AM 100 SECURITY 01/18/2019 09:42 AM server 01/21/2019 03:03 PM web-ui 01/09/2019 08:59 AM 27 _config.yml 16 File(s) 257,348 bytes 10 Dir(s) 343,807,307,776 bytes free

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

. 01/21/2019 03:03 PM .. 01/09/2019 08:59 AM 35 .babelrc 01/09/2019 08:59 AM 240 .editorconfig 01/09/2019 08:59 AM 18 .eslintignore 01/09/2019 08:59 AM 321 .eslintrc 01/09/2019 08:59 AM 91 .npmignore 01/09/2019 08:59 AM 40 .npmrc 01/09/2019 08:59 AM 262 Dockerfile 01/09/2019 08:59 AM 262 Dockerfile - Original 01/09/2019 08:59 AM 259 jest.config.js 01/09/2019 08:59 AM 147 jest.setup.js 01/09/2019 08:59 AM 46 nodemon.json 01/18/2019 09:31 AM node_modules 01/16/2019 03:57 PM 39,051 package-lock.json 01/18/2019 09:31 AM 2,777 package.json 01/09/2019 08:59 AM 5,718 README.md 01/09/2019 08:59 AM 5,718 README.txt 01/09/2019 08:59 AM 480 server.js 01/09/2019 08:59 AM 254 server.mount.js 01/09/2019 08:59 AM src 01/18/2019 09:17 AM target 01/09/2019 08:59 AM webpack 01/17/2019 01:45 PM 320,127 yarn.lock 18 File(s) 375,846 bytes 6 Dir(s) 343,807,307,776 bytes free

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

. 01/21/2019 03:03 PM .. 01/09/2019 08:59 AM 35 .babelrc 01/09/2019 08:59 AM 240 .editorconfig 01/09/2019 08:59 AM 18 .eslintignore 01/09/2019 08:59 AM 321 .eslintrc 01/09/2019 08:59 AM 91 .npmignore 01/09/2019 08:59 AM 40 .npmrc 01/21/2019 03:09 PM 607 Dockerfile 01/09/2019 08:59 AM 262 Dockerfile - Original 01/09/2019 08:59 AM 259 jest.config.js 01/09/2019 08:59 AM 147 jest.setup.js 01/09/2019 08:59 AM 46 nodemon.json 01/18/2019 09:31 AM node_modules 01/16/2019 03:57 PM 39,051 package-lock.json 01/18/2019 09:31 AM 2,777 package.json 01/09/2019 08:59 AM 5,718 README.md 01/09/2019 08:59 AM 5,718 README.txt 01/09/2019 08:59 AM 480 server.js 01/09/2019 08:59 AM 254 server.mount.js 01/09/2019 08:59 AM src 01/18/2019 09:17 AM target 01/09/2019 08:59 AM webpack 01/17/2019 01:45 PM 320,127 yarn.lock 18 File(s) 376,191 bytes 6 Dir(s) 343,862,251,520 bytes free

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

  • yarn@1.13.0 added 1 package in 0.658s npm info ok Removing intermediate container c56e1dcc4ac9 ---> fb1398cf5269 Step 4/14 : FROM yarn-image as builder ---> fb1398cf5269 Step 5/14 : COPY ./ ./ ---> df3ef5328528 Step 6/14 : RUN yarn && yarn build ---> Running in 1e511ff164bd yarn install v1.13.0 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... info fsevents@1.1.3: The platform "linux" is incompatible with this module. info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.6: The platform "linux" is incompatible with this module. info "fsevents@1.2.6" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... warning " > webpack-cli@3.2.1" has incorrect peer dependency "webpack@4.x.x". warning " > webpack-dev-server@3.1.11" has incorrect peer dependency "webpack@^4.0.0". warning "webpack-dev-server > webpack-dev-middleware@3.4.0" has incorrect peer dependency "webpack@^4.0.0". [5/5] Building fresh packages... Done in 38.30s. yarn run v1.13.0 $ webpack --config ./webpack/prod.js Hash: fd652da5d5d795ae9cb8 Version: webpack 3.10.0 Time: 16145ms Asset Size Chunks Chunk Names bundle.js 787 kB 0 [emitted] [big] main bundle.js.map 2.81 MB 0 [emitted] main [9] ./src/client/app/services/oauth-util.js 1.92 kB {0} [built] [22] ./src/client/app/services/http-client.js 1.12 kB {0} [built] [23] ./src/client/app/services/fetch.js 424 bytes {0} [built] [24] ./src/client/app/services/debug.js 353 bytes {0} [built] [40] ./src/client/app/index.jsx 136 bytes {0} [built] [42] ./src/client/app/index.scss 1.18 kB {0} [built] [43] ./node_modules/css-loader!./node_modules/sass-loader/lib/loader.js!./src/client/app/index.scss 3.06 kB {0} [built] [47] ./src/client/app/run.jsx 1.04 kB {0} [built] [60] ./src/client/app/services/oauth-interceptor.js 3.56 kB {0} [built] [61] ./src/client/app/services/oauth-firewall.js 749 bytes {0} [built] [62] ./src/client/app/services/storage.js 443 bytes {0} [built] [63] ./src/client/app/services/rest.js 2.13 kB {0} [built] [64] ./src/client/app/containers/root.jsx 1.03 kB {0} [built] [94] ./src/client/app/containers/app.jsx 3.7 kB {0} [built] [97] ./src/client/app/containers/violations-tab.jsx 4.66 kB {0} [built]
    • 106 hidden modules Webpack Bundle Analyzer saved stats file to /home/target/stats.json Webpack Bundle Analyzer saved report to /home/target/report.html Done in 17.76s. Removing intermediate container 1e511ff164bd ---> e00b33cdc2cb Step 7/14 : FROM yarn-image ---> fb1398cf5269 Step 8/14 : MAINTAINER "http://zalando.github.io/" ---> Running in 8029f3709c32 Removing intermediate container 8029f3709c32 ---> 5cfa0ce97026 Step 9/14 : ENV NODE_ENV=production ---> Running in 39b2367566f5 Removing intermediate container 39b2367566f5 ---> 5743c89a10e0 Step 10/14 : COPY --from=builder /home/package.json /home/server.js /home/yarn.lock ./ ---> 9512ad2ebb0c Step 11/14 : COPY --from=builder /home/src/ ./src ---> 1e3b7f6cf07e Step 12/14 : RUN yarn --production ---> Running in 4963880c90ef yarn install v1.13.0 [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... info fsevents@1.1.3: The platform "linux" is incompatible with this module. info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.6: The platform "linux" is incompatible with this module. info "fsevents@1.2.6" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... warning " > webpack-cli@3.2.1" has incorrect peer dependency "webpack@4.x.x". warning " > webpack-dev-server@3.1.11" has incorrect peer dependency "webpack@^4.0.0". warning "webpack-dev-server > webpack-dev-middleware@3.4.0" has incorrect peer dependency "webpack@^4.0.0". [5/5] Building fresh packages... Done in 22.71s. Removing intermediate container 4963880c90ef ---> 532c3ab523df Step 13/14 : EXPOSE 3000 ---> Running in c1ca633c802f Removing intermediate container c1ca633c802f ---> aafaafcac44f Step 14/14 : CMD ["node", "server.js"] ---> Running in 6b3a68b71736 Removing intermediate container 6b3a68b71736 ---> 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> 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

vivanov19 commented 5 years ago

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

roxspring commented 5 years ago

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.

maxim-tschumak commented 5 years ago

@vivanov19 Did it work out for you?

vivanov19 commented 5 years ago

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).

  1. 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.

  2. 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

  1. Rob suggested to "run Zally under Windows 10 but using Windows Subsystem for Linux (Ubuntu 18.04 specifically) and can strongly recommend that approach". I am not sure what exactly should be done to do this.

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

maxim-tschumak commented 5 years ago

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).

roxspring commented 5 years ago

These are tested notes based on my setup, happy to move them into a markdown document in the project if that helps...

Building Under Windows Subsystem for Linux

The following notes document my working environment for building and testing a full Zally installation from a Windows 10 workstation.

Prepare Windows Environment

Prepare Linux Environment

Build and Run

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)

Testing

Use a browser to check that things are working correctly:

Troubleshooting

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'".
maxim-tschumak commented 5 years ago

Let's add this page to the docs.

roxspring commented 5 years ago

A few further thoughts that occurred to me while checking the WSL notes above:

  1. 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.

  2. I wonder if we're confusing matters by having the web-ui talk about port 3000 but then map 8080 -> 3000 during docker-compose.

  3. @vivanov19 in addition to @maxim-tschumak's point above, have you confirmed that you have no other servers running on port 3000 or 8080?

maxim-tschumak commented 5 years ago
  1. 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.

roxspring commented 5 years ago

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.

vivanov19 commented 5 years ago

Thank you very much, Rob and Maxim. It is much better understanding now how the framework's components should be integrated.

  1. Yes, there is no server running on 3000 and all services on 8080 stopped.
  2. I will try both options: Docker on Windows with important clarifications above and new for me Linux on Windows, and let you know. It is not a bad idea to have Linux running on Windows no matter what :-)

Thank you very much for the extremely helpful comments.

vadeg commented 3 years ago

No additional actions are required.