3scale / APIcast

3scale API Gateway
Apache License 2.0
305 stars 171 forks source link

Make development failed #957

Closed y-tabata closed 5 years ago

y-tabata commented 5 years ago
Version

CentOS Linux release 7.5.1804 (Core)

docker version: Client: Version: 1.13.1 API version: 1.26 Package version: docker-1.13.1-75.git8633870.el7.centos.x86_64 Go version: go1.9.4 Git commit: 8633870/1.13.1 Built: Fri Sep 28 19:45:08 2018 OS/Arch: linux/amd64

Server: Version: 1.13.1 API version: 1.26 (minimum version 1.12) Package version: docker-1.13.1-75.git8633870.el7.centos.x86_64 Go version: go1.9.4 Git commit: 8633870/1.13.1 Built: Fri Sep 28 19:45:08 2018 OS/Arch: linux/amd64 Experimental: false

docker-compose version: docker-compose version 1.18.0, build 8dd22a9 docker-py version: 2.6.1 CPython version: 3.4.9 OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017

Description

The make development failed in my environment. Firstly, the --detach option is not supported.

[root@app2 apicast]# make development
docker-compose -f docker-compose-devel.yml up --detach
Builds, (re)creates, starts, and attaches to containers for a service.

Unless they are already running, this command also starts any linked services.

The `docker-compose up` command aggregates the output of each container. When
the command exits, all containers are stopped. Running `docker-compose up -d`
starts the containers in the background and leaves them running.

If there are existing containers for a service, and the service's configuration
or image was changed after the container's creation, `docker-compose up` picks
up the changes by stopping and recreating the containers (preserving mounted
volumes). To prevent Compose from picking up changes, use the `--no-recreate`
flag.

If you want to force Compose to stop and recreate all containers, use the
`--force-recreate` flag.

Usage: up [options] [--scale SERVICE=NUM...] [SERVICE...]

Options:
    -d                         Detached mode: Run containers in the background,
                               print new container names. Incompatible with
                               --abort-on-container-exit and --timeout.
    --no-color                 Produce monochrome output.
    --no-deps                  Don't start linked services.
    --force-recreate           Recreate containers even if their configuration
                               and image haven't changed.
                               Incompatible with --no-recreate.
    --no-recreate              If containers already exist, don't recreate them.
                               Incompatible with --force-recreate.
    --no-build                 Don't build an image, even if it's missing.
    --no-start                 Don't start the services after creating them.
    --build                    Build images before starting containers.
    --abort-on-container-exit  Stops all containers if any container was stopped.
                               Incompatible with -d.
    -t, --timeout TIMEOUT      Use this timeout in seconds for container shutdown
                               when attached or when containers are already.
                               Incompatible with -d.
                               running. (default: 10)
    --remove-orphans           Remove containers for services not
                               defined in the Compose file
    --exit-code-from SERVICE   Return the exit code of the selected service container.
                               Implies --abort-on-container-exit.
    --scale SERVICE=NUM        Scale SERVICE to NUM instances. Overrides the `scale`
                               setting in the Compose file if present.
make: [development] エラー 1 (無視されました)
docker-compose -f docker-compose-devel.yml exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" --user 0 development bash
ERROR: No container found for development_1
make: *** [development] エラー 1

So I changed --detach to -d.

Secondly, the cached mode and the delegated mode is invalid.

[root@app2 apicast]# make development
docker-compose -f docker-compose-devel.yml up -d
apicastbuild0_redis_1 is up-to-date
Recreating apicastbuild0_development_1 ... error

ERROR: for apicastbuild0_development_1  Cannot create container for service development: invalid bind mount spec "/root/apicast:/home/centos:cached": invalid mode: cached

ERROR: for development  Cannot create container for service development: invalid bind mount spec "/root/apicast:/home/centos:cached": invalid mode: cached
ERROR: Encountered errors while bringing up the project.
make: [development] エラー 1 (無視されました)
docker-compose -f docker-compose-devel.yml exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" --user 0 development bash
ERROR: No container found for development_1
make: *** [development] エラー 1

So I removed the cached and the delegated

Thirdly, the development_1 exited.

[root@app2 apicast]# make development
docker-compose -f docker-compose-devel.yml up -d
apicastbuild0_redis_1 is up-to-date
Starting 9192ead0da1e_apicastbuild0_development_1 ... done
docker-compose -f docker-compose-devel.yml exec -e COLUMNS="`tput cols`" -e LINES="`tput lines`" --user 0 development bash
ERROR: No container found for development_1
make: *** [development] エラー 1

[root@app2 apicast]# docker ps -a
CONTAINER ID        IMAGE                                         COMMAND                  CREATED             STATUS                        PORTS               NAMES
9192ead0da1e        quay.io/3scale/s2i-openresty-centos7:master   "container-entrypo..."   About an hour ago   Exited (127) 29 seconds ago                       9192ead0da1e_apicastbuild0_development_1
031aa51c2e81        redis                                         "docker-entrypoint..."   About an hour ago   Up About an hour              6379/tcp            apicastbuild0_redis_1

[root@app2 apicast]# docker logs 9192ead0da1e
exec -- failed: No such file or directory
exec -- failed: No such file or directory

Is there any prerequisites?

Steps To Reproduce
  1. yum install docker
  2. yum install docker-compose
  3. git clone https://github.com/3scale/apicast.git
  4. cd apicast
  5. make dependencies
mikz commented 5 years ago

@y-tabata yes, unfortunately the RedHat Docker is not supported. We depend on the upstream docker engine.

pimg commented 5 years ago

I experienced the same issue. For me upgrading both the Docker daemon and Docker-compose resolved the issue for me.

I am now running the development container with Docker 18.09.0, build 4d60db4 and Docker compose version 1.23.1, build b02f1306

hope it helps

y-tabata commented 5 years ago

@mikz 3scale requires OCP or OKD. OCP and OKD lead us to use the RedHat Docker in their installation guide. So it feels strange to me not to support it.

mikz commented 5 years ago

@y-tabata I understand you, but this is an unfortunate situation because of Red Hat fork of Docker that does not have all the features the upstream has.

We can't really have acceptable performance on macOS without those flags available in the upstream Docker. The only solution I see is detecting the docker version and using different docker-compose file or using ENV or something to make it work. Patches welcome. I don't have Red Hat Docker available, only macOS and the upstream Docker.

y-tabata commented 5 years ago

I understand. Thank you @mikz, @pimg!

mikz commented 5 years ago

@y-tabata OKD and possibly OCP should work with the upstream docker engine. It should be fine for development purposes, not as a production environment.