From 1db6350f6415f81c294d974e194a578848de8c54 Mon Sep 17 00:00:00 2001 From: Tim Zallmann <tim@tpmgames.com> Date: Fri, 12 May 2017 09:00:22 +0200 Subject: [PATCH 1/5] Added a step-by-step Windows 10 Bash Setup Guide --- doc/prepare.md | 2 + doc/set-up-winbash.md | 95 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 doc/set-up-winbash.md diff --git a/doc/prepare.md b/doc/prepare.md index ce18065..eda5894 100644 --- a/doc/prepare.md +++ b/doc/prepare.md @@ -239,6 +239,8 @@ Start the PostgreSQL database sudo service postgresql start ``` +For a Windows 10 Bash Setup Guide of the GDK please follow this [guide](./set-up-winbash.md) + For some common troubleshooting steps for Windows 10 GDK installs please refer to [Troubleshooting](./howto/troubleshooting.md) ### Other platforms diff --git a/doc/set-up-winbash.md b/doc/set-up-winbash.md new file mode 100644 index 0000000..ab7b322 --- /dev/null +++ b/doc/set-up-winbash.md @@ -0,0 +1,95 @@ +# **Experimental** : Set up GDK on Windows 10 Bash + +## Setting up GDK on WSL (Linux Bash on Windows, Ubuntu 16.04 Base) + +This is a step-by-step guide on how to get the GDK working under the current `Windows 10 Bash (Creators Update / April 2017)`. Due to the overlapping of directories between Windows and the Linux subsystem, you will need a little bit of a workaround to get it working, so that you can also edit files from Window but let it run under the Linux subsystem. If you would install it only in the `mnt` directory you would run into permission errors (especially with sockets). + +1. Create a non root User or use an existing one + +2. Prepare your machine based on this [guide for WSL](./prepare.md#experimental-windows-10-using-the-wsl-windows-subsystem-for-linux) + +3. Install GDK normally in the users home directory (~) with [gdk install](./set-up-gdk.md) + +4. Run it with `gdk run` (Can take quite a while until it starts, refresh multiple times in browser 'localhost:3000') , after some time (~30 minutes) it will come up and show the `users/sign_in` page (couple of 502 / EOF errors before it starts correctly, restarting the whole machine also helps) + +5. So now you should have a fully running GDK instance , try it out by logging in on [http://localhost:3000](http://localhost:3000) and browse. Only problem is you can’t really edit those files from the Windows machine (permission problems , etc. MS even states don’t edit Linux files with Windows applications) + +6. What we will do is now do a second installation in your `/mnt/…` directory which is setup with your Windows hard drive. So I will create a directory on `C:/` with the name `tzwsl` (as an example) + +7. Run in your bash `cd /mnt/c/tzwsl` + +8. Run here again `gdk init` + +9. Change to the created directory `cd gitlab-development-kit` + +10. Run `gdk install` + +11. Rund `gdk run` -> Now you will get multiple errors as WSL has a problem to create .socket files in mnt due to permission problems . Solution reconfigure GDK to use the directory in `/home/…` for creating the sockets + +12. **./Procfile** changes : + + 1. Get Redis running : +Change in **./Procfile** the line : +`redis: exec redis-server /mnt/c/tzwsl/gitlab-development-kit/redis/redis.conf` +To the path of your /home installation +`redis: exec redis-server /home/tz/gitlab-development-kit/redis/redis.conf` + + 2. Get Postgres Running : +Change that line +`postgresql: exec support/postgresql-signal-wrapper /usr/lib/postgresql/9.5/bin/postgres -D /mnt/c/tzwsl/gitlab-development-kit/postgresql/data -k /mnt/c/tzwsl/gitlab-development-kit/postgresql -h ''` +Again pointing at your /home/ installation +`postgresql: exec support/postgresql-signal-wrapper /usr/lib/postgresql/9.5/bin/postgres -D /home/tz/gitlab-development-kit/postgresql/data -k /home/tz/gitlab-development-kit/postgresql -h ''` + + 3. Point gitlab-workhorse to your home directory (only for socket) : +Change : +`gitlab-workhorse: exec /usr/bin/env PATH="/mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/bin:$PATH" gitlab-workhorse -authSocket /mnt/c/tzwsl/gitlab-development-kit/gitlab.socket -listenAddr $host:$port -documentRoot /mnt/c/tzwsl/gitlab-development-kit/gitlab/public -developmentMode -secretPath /mnt/c/tzwsl/gitlab-development-kit/gitlab/.gitlab_workhorse_secret -config /mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/config.toml` +To : +`gitlab-workhorse: exec /usr/bin/env PATH="/mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/bin:$PATH" gitlab-workhorse -authSocket /home/tz/gitlab-development-kit/gitlab.socket -listenAddr $host:$port -documentRoot /mnt/c/tzwsl/gitlab-development-kit/gitlab/public -developmentMode -secretPath /mnt/c/tzwsl/gitlab-development-kit/gitlab/.gitlab_workhorse_secret -config /mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/config.toml` + +13. Run `gdk install` again, then it finished for me also with cloning gitaly, etc. + +14. Configure gitaly (if you retry gdk run after this , it shouldn’t stop anymore with gitaly problems) : +Go to **/gitaly/config.toml** , change from : +`socket_path = "/mnt/c/tzwsl/gitlab-development-kit/gitaly.socket"` +To Using Sockets (-> overrides the socket creation problem) +`socket_path = ""` +`listen_addr = "localhost:1234"` + +15. Get the Rails Application working : +Change in **\gitlab\config\unicorn.rb** the configuration : +`listen '/mnt/c/tzwsl/gitlab-development-kit/gitlab.socket'` +To +`listen '/home/tz/gitlab-development-kit/gitlab.socket'` + +16. Change the Redis.socket Path in **/gitlab/config/resque.yml** : +`development: unix:/mnt/c/tzwsl/gitlab-development-kit/redis/redis.socket` +`test: unix:/mnt/c/tzwsl/gitlab-development-kit/redis/redis.socket` +To +`development: unix:/home/tz/gitlab-development-kit/redis/redis.socket` +`test: unix:/home/tz/gitlab-development-kit/redis/redis.socket` + +17. Fix the GItlab Workhorse Config to the new Redis Path : +Change in **/gitlab-workhorse/config.toml** the line : +`URL = "unix:///mnt/c/tzwsl/gitlab-development-kit/redis/redis.socket"` +To the /home Path : +`URL = "unix:///home/tz/gitlab-development-kit/redis/redis.socket"` + +18. Update the Database Socket in **/gitlab/config/database.yml** : +CHange the 2 host paths : +`host: /mnt/c/tzwsl/gitlab-development-kit/postgresql` +To using your home path : +`host: /home/tz/gitlab-development-kit/postgresql` + +19. Update the Path to the example repositories (somehow it is not possible to pull them in the /mnt/ directory with the default installation) : +Go to the **/gitlab/config/gitlab.yml** and change : +`path: /mnt/c/tzwsl/gitlab-development-kit/repositories/` +To +`path: /home/tz/gitlab-development-kit/repositories/` +Also Update the gitaly url in the line below from : +`gitaly_address: unix:/mnt/c/tzwsl/gitlab-development-kit/gitaly.socket` +To the TCP Address : +`gitaly_address: tcp://localhost:1234` + +20. Run it again `gdk run` + +21. You should have now a GDK instance running on `localhost:3000` in your browser which is taking the Source files from the `/mnt/` installation but simply saves some of the needed connection parts in the `/home/` installation -- GitLab From 044fcc1209c016ed94de617a0f87ad782b5eb28b Mon Sep 17 00:00:00 2001 From: Tim Zallmann <tzallmann@gitlab.com> Date: Fri, 12 May 2017 15:39:26 +0200 Subject: [PATCH 2/5] Couple of minor fixes --- doc/set-up-winbash.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/set-up-winbash.md b/doc/set-up-winbash.md index ab7b322..7976beb 100644 --- a/doc/set-up-winbash.md +++ b/doc/set-up-winbash.md @@ -4,9 +4,9 @@ This is a step-by-step guide on how to get the GDK working under the current `Windows 10 Bash (Creators Update / April 2017)`. Due to the overlapping of directories between Windows and the Linux subsystem, you will need a little bit of a workaround to get it working, so that you can also edit files from Window but let it run under the Linux subsystem. If you would install it only in the `mnt` directory you would run into permission errors (especially with sockets). -1. Create a non root User or use an existing one +1. Create a non-root user or use an existing one -2. Prepare your machine based on this [guide for WSL](./prepare.md#experimental-windows-10-using-the-wsl-windows-subsystem-for-linux) +2. Prepare your machine based on this [guide for WSL](./prepare.md#experimental-windows-10-using-the-wsl-windows-subsystem-for-linux). 3. Install GDK normally in the users home directory (~) with [gdk install](./set-up-gdk.md) @@ -92,4 +92,4 @@ To the TCP Address : 20. Run it again `gdk run` -21. You should have now a GDK instance running on `localhost:3000` in your browser which is taking the Source files from the `/mnt/` installation but simply saves some of the needed connection parts in the `/home/` installation +21. You should have now a GDK instance running on `localhost:3000` in your browser which is taking the Source files from the `/mnt/` installation but simply saves some of the needed connection sockets in the `/home/` installation -- GitLab From e76fc8b6a3545a9ab1a9e483cc4bbbd067a79a6d Mon Sep 17 00:00:00 2001 From: Tim Zallmann <tzallmann@gitlab.com> Date: Sat, 13 May 2017 00:19:52 +0200 Subject: [PATCH 3/5] Textual Changes to WinBash Description --- doc/set-up-winbash.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/set-up-winbash.md b/doc/set-up-winbash.md index 7976beb..4e80d6d 100644 --- a/doc/set-up-winbash.md +++ b/doc/set-up-winbash.md @@ -2,7 +2,7 @@ ## Setting up GDK on WSL (Linux Bash on Windows, Ubuntu 16.04 Base) -This is a step-by-step guide on how to get the GDK working under the current `Windows 10 Bash (Creators Update / April 2017)`. Due to the overlapping of directories between Windows and the Linux subsystem, you will need a little bit of a workaround to get it working, so that you can also edit files from Window but let it run under the Linux subsystem. If you would install it only in the `mnt` directory you would run into permission errors (especially with sockets). +This is a step-by-step guide on how to get the GDK working under the current `Windows 10 Bash (Creators Update / April 2017)`. Due to the overlapping of directories between Windows and the Linux subsystem, you will need a little bit of a workaround to get it working, so that you can also edit files from Windows but let it run under the Linux subsystem. If you would install it only in the `mnt` directory you would run into permission errors (especially with sockets). 1. Create a non-root user or use an existing one @@ -10,21 +10,21 @@ This is a step-by-step guide on how to get the GDK working under the current `Wi 3. Install GDK normally in the users home directory (~) with [gdk install](./set-up-gdk.md) -4. Run it with `gdk run` (Can take quite a while until it starts, refresh multiple times in browser 'localhost:3000') , after some time (~30 minutes) it will come up and show the `users/sign_in` page (couple of 502 / EOF errors before it starts correctly, restarting the whole machine also helps) +4. Run it with `gdk run` (Can take quite a while until it starts, refresh multiple times in browser 'localhost:3000') , after some time (time will depend on your hardware and setup) it will come up and show the `users/sign_in` page (couple of 502 / EOF errors before it starts correctly, restarting the whole machine also helps) 5. So now you should have a fully running GDK instance , try it out by logging in on [http://localhost:3000](http://localhost:3000) and browse. Only problem is you can’t really edit those files from the Windows machine (permission problems , etc. MS even states don’t edit Linux files with Windows applications) 6. What we will do is now do a second installation in your `/mnt/…` directory which is setup with your Windows hard drive. So I will create a directory on `C:/` with the name `tzwsl` (as an example) -7. Run in your bash `cd /mnt/c/tzwsl` +7. Now change directory `cd /mnt/c/tzwsl` -8. Run here again `gdk init` +8. Run `gdk init` 9. Change to the created directory `cd gitlab-development-kit` 10. Run `gdk install` -11. Rund `gdk run` -> Now you will get multiple errors as WSL has a problem to create .socket files in mnt due to permission problems . Solution reconfigure GDK to use the directory in `/home/…` for creating the sockets +11. Run `gdk run` -> Now you will get multiple errors as WSL has a problem to create .socket files in mnt due to permission problems. Solution reconfigure GDK to use the directory in `/home/…` for creating the sockets 12. **./Procfile** changes : @@ -46,7 +46,7 @@ Change : To : `gitlab-workhorse: exec /usr/bin/env PATH="/mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/bin:$PATH" gitlab-workhorse -authSocket /home/tz/gitlab-development-kit/gitlab.socket -listenAddr $host:$port -documentRoot /mnt/c/tzwsl/gitlab-development-kit/gitlab/public -developmentMode -secretPath /mnt/c/tzwsl/gitlab-development-kit/gitlab/.gitlab_workhorse_secret -config /mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/config.toml` -13. Run `gdk install` again, then it finished for me also with cloning gitaly, etc. +13. Run `gdk install` again, then it it should be able to finish the installation while also cloning gitaly, etc. 14. Configure gitaly (if you retry gdk run after this , it shouldn’t stop anymore with gitaly problems) : Go to **/gitaly/config.toml** , change from : -- GitLab From 88fc9501c50f10b9c8a471000732b181dde56905 Mon Sep 17 00:00:00 2001 From: Tim Zallmann <tzallmann@gitlab.com> Date: Mon, 15 May 2017 12:49:11 +0200 Subject: [PATCH 4/5] Added a tip for alias setup --- doc/set-up-winbash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/set-up-winbash.md b/doc/set-up-winbash.md index 4e80d6d..9d677ee 100644 --- a/doc/set-up-winbash.md +++ b/doc/set-up-winbash.md @@ -16,7 +16,7 @@ This is a step-by-step guide on how to get the GDK working under the current `Wi 6. What we will do is now do a second installation in your `/mnt/…` directory which is setup with your Windows hard drive. So I will create a directory on `C:/` with the name `tzwsl` (as an example) -7. Now change directory `cd /mnt/c/tzwsl` +7. Now change directory `cd /mnt/c/tzwsl` (Tip: Create an alias to go make it easier to reach your mounted directory `alias wslhome="cd /mnt/c/Users/YOUR_USER_NAME_HERE"`) 8. Run `gdk init` -- GitLab From d42f9c53f1af5ca0778ed39ab916021418005f36 Mon Sep 17 00:00:00 2001 From: Tim Zallmann <tzallmann@gitlab.com> Date: Wed, 17 May 2017 10:06:15 +0200 Subject: [PATCH 5/5] Added some more textual fixes to the WSL guide --- doc/set-up-winbash.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/set-up-winbash.md b/doc/set-up-winbash.md index 9d677ee..5ef1151 100644 --- a/doc/set-up-winbash.md +++ b/doc/set-up-winbash.md @@ -10,7 +10,7 @@ This is a step-by-step guide on how to get the GDK working under the current `Wi 3. Install GDK normally in the users home directory (~) with [gdk install](./set-up-gdk.md) -4. Run it with `gdk run` (Can take quite a while until it starts, refresh multiple times in browser 'localhost:3000') , after some time (time will depend on your hardware and setup) it will come up and show the `users/sign_in` page (couple of 502 / EOF errors before it starts correctly, restarting the whole machine also helps) +4. Run it with `gdk run` (Can take quite a while until it starts, refresh multiple times in browser [http://localhost:3000](http://localhost:3000)) , after some time (time will depend on your hardware and setup) it will come up and show the `users/sign_in` page (couple of 502 / EOF errors before it starts correctly, restarting the whole machine also helps) 5. So now you should have a fully running GDK instance , try it out by logging in on [http://localhost:3000](http://localhost:3000) and browse. Only problem is you can’t really edit those files from the Windows machine (permission problems , etc. MS even states don’t edit Linux files with Windows applications) @@ -24,7 +24,7 @@ This is a step-by-step guide on how to get the GDK working under the current `Wi 10. Run `gdk install` -11. Run `gdk run` -> Now you will get multiple errors as WSL has a problem to create .socket files in mnt due to permission problems. Solution reconfigure GDK to use the directory in `/home/…` for creating the sockets +11. Run `gdk run` -> Now you will get multiple errors as WSL has a problem to create .socket files in mnt due to permission problems. The solution is to reconfigure the GDK to use the installation in the `/home` directory for creating the sockets 12. **./Procfile** changes : @@ -46,7 +46,7 @@ Change : To : `gitlab-workhorse: exec /usr/bin/env PATH="/mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/bin:$PATH" gitlab-workhorse -authSocket /home/tz/gitlab-development-kit/gitlab.socket -listenAddr $host:$port -documentRoot /mnt/c/tzwsl/gitlab-development-kit/gitlab/public -developmentMode -secretPath /mnt/c/tzwsl/gitlab-development-kit/gitlab/.gitlab_workhorse_secret -config /mnt/c/tzwsl/gitlab-development-kit/gitlab-workhorse/config.toml` -13. Run `gdk install` again, then it it should be able to finish the installation while also cloning gitaly, etc. +13. Run `gdk install` again, then it should be able to finish the installation while also cloning gitaly, etc. 14. Configure gitaly (if you retry gdk run after this , it shouldn’t stop anymore with gitaly problems) : Go to **/gitaly/config.toml** , change from : @@ -68,16 +68,16 @@ To `development: unix:/home/tz/gitlab-development-kit/redis/redis.socket` `test: unix:/home/tz/gitlab-development-kit/redis/redis.socket` -17. Fix the GItlab Workhorse Config to the new Redis Path : +17. Fix the GitLab Workhorse Config to the new Redis Path : Change in **/gitlab-workhorse/config.toml** the line : `URL = "unix:///mnt/c/tzwsl/gitlab-development-kit/redis/redis.socket"` To the /home Path : `URL = "unix:///home/tz/gitlab-development-kit/redis/redis.socket"` 18. Update the Database Socket in **/gitlab/config/database.yml** : -CHange the 2 host paths : +Change the 2 host paths : `host: /mnt/c/tzwsl/gitlab-development-kit/postgresql` -To using your home path : +So they use the installation in your home path instead : `host: /home/tz/gitlab-development-kit/postgresql` 19. Update the Path to the example repositories (somehow it is not possible to pull them in the /mnt/ directory with the default installation) : -- GitLab