Commit cde1997e authored by Gabriel Mazetto's avatar Gabriel Mazetto 🚀

Fix documentation and refactor license check to Runtime::Env

parent 7edba5b6
......@@ -7,3 +7,4 @@
/pkg/
/spec/reports/
/tmp/
/.idea
# QA Tool support on Mac OS
Most of our development for GitLab is done in Mac OS. This brings some challenges as Docker on
Most of our development for GitLab is done on Mac OS. This brings some challenges as Docker on
Mac OS doesn't have feature parity with it's Linux conterpart.
There are two ways of running Docker on a Mac. Use a docker-machine provisioned virtual-machine
or user "native" Docker GUI based support.
or use "native" Docker GUI based support.
When using docker-machine you can run your machines in the cloud or locally using something like
VirtualBox. This brings some extra options on how to expose network between Mac OS and the Linux
host VM, but requires extra steps like mapping `$DOCKER_HOST`, booting up and down the VMs with
docker-machine and possibly customizing network settings in the virtualization platform of choice.
Native docker bundles it's own lightweight virtualization technology that works just like virtualbox,
but without requiring manual intervention. This provides less opportunity to customize network,
but works out of the box when mapping container ports to ports on localhost.
Native Docker bundles it's own lightweight virtualization technology that works just like VirtualBox,
but without requiring manual intervention. This provides less opportunity to customize network between
docker containers and the host machine, but works out of the box when mapping container ports to ports
on localhost.
The major difference is that it never exposes the network as "bridge", and so `--host=` never works.
The major difference is that it never exposes the network as `bridge` to Mac OS, and so `--hostname`
and `--network` only work inside docker, it has no effect when trying to access the containers from Mac OS.
There are people in Docker's forum that claims to be able to [expose the network](Docker Route)
There are people in Docker's forum that claim to be able to [expose the network][Docker Route]
when using a mix of docker-machine and `route` CLI command.
When using the `route` command to expose the internet network, you still need to glue the DNS part.
There is another tool called [dnsdock](dnsdock) that may do the trick. That means you need to change
There is another tool called [dnsdock][dnsdock] that may do the trick. That means you need to change
your DNS and point to the IP/port of `dnsdock` application.
# Native Docker GUI caveats
......@@ -33,12 +35,15 @@ This is required because chrome-webdriver makes use of `/dev/shm` shared memory.
~ 3Gb but unless you allocate 5.0 or more some magic numbers may not enable a bigger /dev/shm in the
'host' VM that "native" docker runs on.
Please note that while it's possible to run multi-node tests like Geo primary and Secondary, you can't
access the machines from your host machine, as they are all exposed as `localhost:port`, and because
Please note that while it's possible to run multi-node tests like Geo Primary and Secondary, you can't
access the machines from your host machine, as they are all exposed as `0.0.0.0:port`, and because
of that they don't match the configured VHOSTs in your GitLab installation, so the redirect login
fails.
To see if this limitation is still present, check the [documentation](Docker Networking).
It has to do with the lack of `bridge` support from Docker on Mac OS, also this is also something
Docker Inc [doesn't want to fix][Docker bridge issue].
To see if this limitation is still present, check the [documentation][Docker Networking].
## Workarounds
......@@ -89,5 +94,6 @@ You should be able to use your navigator and point it to `http://gitlab-primary.
[Docker Route]: https://forums.docker.com/t/access-container-from-dev-machine-by-ip-dns-name/24631/5
[Docker Networking]: https://docs.docker.com/docker-for-mac/networking/#known-limitations-use-cases-and-workarounds
[Docker bridge issue]: https://github.com/moby/moby/issues/22753#issuecomment-253534261
[dnsdock]: https://github.com/aacebedo/dnsdock
......@@ -20,6 +20,12 @@ module Gitlab
def delegated
VARIABLES.select { |name| ENV[name] }
end
def require_license!
return if ENV.include?('EE_LICENSE')
raise ArgumentError, 'GitLab License is not available. Please load a license into EE_LICENSE env variable.'
end
end
end
end
......
......@@ -13,10 +13,8 @@ module Gitlab
release = Release.new(release)
raise ArgumentError, 'Geo is EE only!' unless release.ee?
unless license_available?
raise ArgumentError, 'GitLab License is not available. Please load a license into EE_LICENSE env variable.'
end
Runtime::Env.require_license!
Component::Gitlab.perform do |primary|
primary.release = release
......@@ -73,12 +71,6 @@ module Gitlab
end
end
end
private
def license_available?
ENV.include?('EE_LICENSE')
end
end
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment