Fix Ruby in Docker container on Apple silicon #168

Merged
raucao merged 3 commits from chore/fix_docker_ruby_on_apple_silicon into chore/update_dependencies 2024-02-22 14:12:05 +00:00
Owner

Builds Ruby 3.3.0 from source, with the fix from https://github.com/ruby/ruby/pull/9371 applied to it.

(When using with Docker Compose, it only has to be built once, even when rebuilding other parts of the container later.)

Builds Ruby 3.3.0 from source, with the fix from https://github.com/ruby/ruby/pull/9371 applied to it. (When using with Docker Compose, it only has to be built once, even when rebuilding other parts of the container later.)
raucao added 1 commit 2024-02-22 09:51:18 +00:00
Fix Ruby in Docker container on Apple silicon
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
bbf3fb91a0
raucao requested review from galfert 2024-02-22 09:51:31 +00:00
raucao requested review from slvrbckt 2024-02-22 09:51:31 +00:00
raucao added a new dependency 2024-02-22 09:52:24 +00:00
Owner

I tried to build it but it eventually failed:

$ docker compose up --build -d
...
75.91 Installing devise_ldap_authenticatable 0.8.7
75.93 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
75.93 
75.93 current directory:
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ext/sqlite3
75.93 /opt/rubies/ruby-3.3.0/bin/ruby extconf.rb
75.93 Building sqlite3-ruby using packaged sqlite3.
75.93 Extracting sqlite-autoconf-3450100.tar.gz into
75.93 tmp/aarch64-linux-gnu/ports/sqlite3/3.45.1... OK
75.93 Running 'configure' for sqlite3 3.45.1... OK
75.93 Running 'compile' for sqlite3 3.45.1... OK
75.93 Running 'install' for sqlite3 3.45.1... OK
75.93 Activating sqlite3 3.45.1 (from
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1)...
75.93 checking for pkg-config for
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc...
75.93 not found
75.93 
75.93 Could not configure the build properly (pkg_config). Please install either the
75.93 `pkg-config` utility or the `pkg-config` rubygem.
75.93 
75.93 *** extconf.rb failed ***
75.93 Could not create Makefile due to some reason, probably lack of necessary
75.93 libraries and/or headers.  Check the mkmf.log file for more details.  You may
75.93 need configuration options.
75.93 
75.93 Provided configuration options:
75.93   --with-opt-dir
75.93   --without-opt-dir
75.93   --with-opt-include=${opt-dir}/include
75.93   --without-opt-include
75.93   --with-opt-lib=${opt-dir}/lib
75.93   --without-opt-lib
75.93   --with-make-prog
75.93   --without-make-prog
75.93   --srcdir=.
75.93   --curdir
75.93   --ruby=/opt/rubies/ruby-3.3.0/bin/$(RUBY_BASE_NAME)
75.93   --help
75.93   --download-dependencies
75.93   --with-sqlcipher
75.93   --without-sqlcipher
75.93   --with-sqlcipher-dir
75.93   --without-sqlcipher-dir
75.93   --with-sqlcipher-include
75.93   --without-sqlcipher-include
75.93   --with-sqlcipher-lib
75.93   --without-sqlcipher-lib
75.93   --enable-system-libraries
75.93   --disable-system-libraries
75.93   --with-sqlcipher
75.93   --without-sqlcipher
75.93   --with-sqlcipher-dir
75.93   --without-sqlcipher-dir
75.93   --with-sqlcipher-include
75.93   --without-sqlcipher-include
75.93   --with-sqlcipher-lib
75.93   --without-sqlcipher-lib
75.93   --with-sqlite-source-dir
75.93   --with-sqlite-cflags
75.93   --without-sqlite-cflags
75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir
75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir
75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-include=${/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir}/include
75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-include
75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-lib=${/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir}/lib
75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-lib
75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-config
75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-config
75.93   --with-pkg-config
75.93   --without-pkg-config
75.93 
75.93 To see why this extension failed to compile, please check the mkmf.log which can
75.93 be found here:
75.93 
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/extensions/aarch64-linux/3.3.0-static/sqlite3-1.7.2/mkmf.log
75.93 
75.93 extconf failed, exit code 1
75.93 
75.93 Gem files will remain installed in
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2 for inspection.
75.93 Results logged to
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/extensions/aarch64-linux/3.3.0-static/sqlite3-1.7.2/gem_make.out
75.93 
75.93   /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:125:in `run'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/ext_conf_builder.rb:28:in
75.93 `build'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:193:in
75.93 `build_extension'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:227:in `block in
75.93 build_extensions'
75.93   /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `each'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in
75.93 `build_extensions'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/installer.rb:852:in
75.93 `build_extensions'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/rubygems_gem_installer.rb:76:in
75.93 `build_extensions'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/rubygems_gem_installer.rb:28:in
75.93 `install'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/source/rubygems.rb:205:in
75.93 `install'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/gem_installer.rb:54:in
75.93 `install'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/gem_installer.rb:16:in
75.93 `install_from_spec'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/parallel_installer.rb:132:in
75.93 `do_install'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/parallel_installer.rb:123:in
75.93 `block in worker_pool'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:62:in
75.93 `apply_func'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:57:in
75.93 `block in process_queue'
75.93   <internal:kernel>:187:in `loop'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:54:in
75.93 `process_queue'
75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:90:in
75.93 `block (2 levels) in create_threads'
75.93 
75.93 An error occurred while installing sqlite3 (1.7.2), and Bundler cannot continue.
75.93 
75.93 In Gemfile:
75.93   sqlite3
------
failed to solve: process "/bin/bash -o pipefail -c bundle install" did not complete successfully: exit code: 5
I tried to build it but it eventually failed: ```bash $ docker compose up --build -d ... 75.91 Installing devise_ldap_authenticatable 0.8.7 75.93 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 75.93 75.93 current directory: 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ext/sqlite3 75.93 /opt/rubies/ruby-3.3.0/bin/ruby extconf.rb 75.93 Building sqlite3-ruby using packaged sqlite3. 75.93 Extracting sqlite-autoconf-3450100.tar.gz into 75.93 tmp/aarch64-linux-gnu/ports/sqlite3/3.45.1... OK 75.93 Running 'configure' for sqlite3 3.45.1... OK 75.93 Running 'compile' for sqlite3 3.45.1... OK 75.93 Running 'install' for sqlite3 3.45.1... OK 75.93 Activating sqlite3 3.45.1 (from 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1)... 75.93 checking for pkg-config for 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc... 75.93 not found 75.93 75.93 Could not configure the build properly (pkg_config). Please install either the 75.93 `pkg-config` utility or the `pkg-config` rubygem. 75.93 75.93 *** extconf.rb failed *** 75.93 Could not create Makefile due to some reason, probably lack of necessary 75.93 libraries and/or headers. Check the mkmf.log file for more details. You may 75.93 need configuration options. 75.93 75.93 Provided configuration options: 75.93 --with-opt-dir 75.93 --without-opt-dir 75.93 --with-opt-include=${opt-dir}/include 75.93 --without-opt-include 75.93 --with-opt-lib=${opt-dir}/lib 75.93 --without-opt-lib 75.93 --with-make-prog 75.93 --without-make-prog 75.93 --srcdir=. 75.93 --curdir 75.93 --ruby=/opt/rubies/ruby-3.3.0/bin/$(RUBY_BASE_NAME) 75.93 --help 75.93 --download-dependencies 75.93 --with-sqlcipher 75.93 --without-sqlcipher 75.93 --with-sqlcipher-dir 75.93 --without-sqlcipher-dir 75.93 --with-sqlcipher-include 75.93 --without-sqlcipher-include 75.93 --with-sqlcipher-lib 75.93 --without-sqlcipher-lib 75.93 --enable-system-libraries 75.93 --disable-system-libraries 75.93 --with-sqlcipher 75.93 --without-sqlcipher 75.93 --with-sqlcipher-dir 75.93 --without-sqlcipher-dir 75.93 --with-sqlcipher-include 75.93 --without-sqlcipher-include 75.93 --with-sqlcipher-lib 75.93 --without-sqlcipher-lib 75.93 --with-sqlite-source-dir 75.93 --with-sqlite-cflags 75.93 --without-sqlite-cflags 75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir 75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir 75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-include=${/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir}/include 75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-include 75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-lib=${/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-dir}/lib 75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-lib 75.93 --with-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-config 75.93 --without-/opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2/ports/aarch64-linux-gnu/sqlite3/3.45.1/lib/pkgconfig/sqlite3.pc-config 75.93 --with-pkg-config 75.93 --without-pkg-config 75.93 75.93 To see why this extension failed to compile, please check the mkmf.log which can 75.93 be found here: 75.93 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/extensions/aarch64-linux/3.3.0-static/sqlite3-1.7.2/mkmf.log 75.93 75.93 extconf failed, exit code 1 75.93 75.93 Gem files will remain installed in 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/sqlite3-1.7.2 for inspection. 75.93 Results logged to 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/extensions/aarch64-linux/3.3.0-static/sqlite3-1.7.2/gem_make.out 75.93 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:125:in `run' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/ext_conf_builder.rb:28:in 75.93 `build' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:193:in 75.93 `build_extension' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:227:in `block in 75.93 build_extensions' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `each' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in 75.93 `build_extensions' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/rubygems/installer.rb:852:in 75.93 `build_extensions' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/rubygems_gem_installer.rb:76:in 75.93 `build_extensions' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/rubygems_gem_installer.rb:28:in 75.93 `install' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/source/rubygems.rb:205:in 75.93 `install' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/gem_installer.rb:54:in 75.93 `install' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/gem_installer.rb:16:in 75.93 `install_from_spec' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/parallel_installer.rb:132:in 75.93 `do_install' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/installer/parallel_installer.rb:123:in 75.93 `block in worker_pool' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:62:in 75.93 `apply_func' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:57:in 75.93 `block in process_queue' 75.93 <internal:kernel>:187:in `loop' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:54:in 75.93 `process_queue' 75.93 /opt/rubies/ruby-3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.5/lib/bundler/worker.rb:90:in 75.93 `block (2 levels) in create_threads' 75.93 75.93 An error occurred while installing sqlite3 (1.7.2), and Bundler cannot continue. 75.93 75.93 In Gemfile: 75.93 sqlite3 ------ failed to solve: process "/bin/bash -o pipefail -c bundle install" did not complete successfully: exit code: 5 ```
raucao added 1 commit 2024-02-22 10:30:07 +00:00
Add pkg-config
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
ba7c3795f8
Author
Owner

Added pkg-config to the apt packages. Apparently also only needed for certain architectures.

Added `pkg-config` to the apt packages. Apparently also only needed for certain architectures.
Owner

Ok, that seemed to have worked:

$ docker compose up --build -d
...
 ✔ Network akkounts_internal_network                                                                                                                             Creat...                                     0.0s 
 ✔ Network akkounts_external_network                                                                                                                             Creat...                                     0.0s 
 ✔ Container akkounts-ldap-1                                                                                                                                     Started                                      1.5s 
 ✔ Container akkounts-minio-1                                                                                                                                    Started                                      1.5s 
 ✔ Container akkounts-redis-1                                                                                                                                    Started                                      1.4s 
 ! ldap The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested                                                        0.0s 
 ✔ Container akkounts-web-1                                                                                                                                      Started                                      1.6s 
 ✔ Container akkounts-sidekiq-1                                                                                                                                  Started                                      1.5s 
 ✔ Container akkounts-liquor-cabinet-1                                                                                                                           Sta...                                       1.6s 
 ! liquor-cabinet The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 

$ docker ps
CONTAINER ID   IMAGE                                                COMMAND                  CREATED         STATUS                   PORTS                              NAMES
3f0eba30bdc5   gitea.kosmos.org/5apps/liquor-cabinet:2.0.0-beta.2   "bundle exec rainbow…"   9 minutes ago   Up 8 minutes             0.0.0.0:4567->4567/tcp             akkounts-liquor-cabinet-1
06cf5f6ca3fe   akkounts-web                                         "/usr/bin/tini -- ba…"   9 minutes ago   Up 8 minutes                                                akkounts-web-1
c5ae49ab5bca   akkounts-sidekiq                                     "/usr/bin/tini -- ba…"   9 minutes ago   Up 9 minutes                                                akkounts-sidekiq-1
bf58011e0e06   redis:7-alpine                                       "docker-entrypoint.s…"   9 minutes ago   Up 9 minutes (healthy)                                      akkounts-redis-1
f780b8b0994c   4teamwork/389ds:latest                               "/usr/libexec/dirsrv…"   9 minutes ago   Up 9 minutes (healthy)   3389/tcp, 3636/tcp                 akkounts-ldap-1
76a54cd1412e   quay.io/minio/minio:latest                           "/usr/bin/docker-ent…"   9 minutes ago   Up 9 minutes             0.0.0.0:9000-9001->9000-9001/tcp   akkounts-minio-1
Ok, that seemed to have worked: ```bash $ docker compose up --build -d ... ✔ Network akkounts_internal_network Creat... 0.0s ✔ Network akkounts_external_network Creat... 0.0s ✔ Container akkounts-ldap-1 Started 1.5s ✔ Container akkounts-minio-1 Started 1.5s ✔ Container akkounts-redis-1 Started 1.4s ! ldap The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s ✔ Container akkounts-web-1 Started 1.6s ✔ Container akkounts-sidekiq-1 Started 1.5s ✔ Container akkounts-liquor-cabinet-1 Sta... 1.6s ! liquor-cabinet The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 3f0eba30bdc5 gitea.kosmos.org/5apps/liquor-cabinet:2.0.0-beta.2 "bundle exec rainbow…" 9 minutes ago Up 8 minutes 0.0.0.0:4567->4567/tcp akkounts-liquor-cabinet-1 06cf5f6ca3fe akkounts-web "/usr/bin/tini -- ba…" 9 minutes ago Up 8 minutes akkounts-web-1 c5ae49ab5bca akkounts-sidekiq "/usr/bin/tini -- ba…" 9 minutes ago Up 9 minutes akkounts-sidekiq-1 bf58011e0e06 redis:7-alpine "docker-entrypoint.s…" 9 minutes ago Up 9 minutes (healthy) akkounts-redis-1 f780b8b0994c 4teamwork/389ds:latest "/usr/libexec/dirsrv…" 9 minutes ago Up 9 minutes (healthy) 3389/tcp, 3636/tcp akkounts-ldap-1 76a54cd1412e quay.io/minio/minio:latest "/usr/bin/docker-ent…" 9 minutes ago Up 9 minutes 0.0.0.0:9000-9001->9000-9001/tcp akkounts-minio-1 ```
Author
Owner

OK, but if you daemonize it, then you won't see things in the started container working or failing, like e.g. the Ruby gem that this PR fixes.

Given that everything started successfully, you should be able to use the quick start instructions from the README, in order to set up the directory and seed the database(s). Then you could log in at http://localhost:3000.

OK, but if you daemonize it, then you won't see things in the started container working or failing, like e.g. the Ruby gem that this PR fixes. Given that everything started successfully, you should be able to use the quick start instructions from the README, in order to set up the directory and seed the database(s). Then you could log in at http://localhost:3000.
Author
Owner

@slvrbckt By the way, don't forget to use the actual review comment/approve function when reviewing PRs, so that you get your automatic review kredits issued later...

@slvrbckt By the way, don't forget to use the actual review comment/approve function when reviewing PRs, so that you get your automatic review kredits issued later...
Owner

Yeah, I checked the logs and nothing looked bad that I noticed.

Carrying on with the instructions from the README:

$ docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"
The database was sucessfully created

$ docker compose run web rails ldap:setup
[+] Creating 2/0
 ✔ Container akkounts-ldap-1   Running                                                                                                                                                                        0.0s 
 ✔ Container akkounts-redis-1  Running                                                                                                                                                                        0.0s 
WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value.
WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value.
WARNING: table: "settings" does not exist or not database connection, `Setting.reserved_usernames` fallback to returns the default value.
Deleting entry: cn=admin_role,ou=kosmos.org,cn=users,dc=kosmos,dc=org
false
Adding entry: dc=kosmos,dc=org
Adding entry: cn=users,dc=kosmos,dc=org
Adding entry: ou=kosmos.org,cn=users,dc=kosmos,dc=org
Adding entry: cn=admin_role,ou=kosmos.org,cn=users,dc=kosmos,dc=org

$ docker compose run web rails db:setup
[+] Creating 2/0
 ✔ Container akkounts-ldap-1   Running                                                                                                                                                                        0.0s 
 ✔ Container akkounts-redis-1  Running                                                                                                                                                                        0.0s 
WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value.
WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value.
WARNING: table: "settings" does not exist or not database connection, `Setting.reserved_usernames` fallback to returns the default value.
Database 'db/development.sqlite3' already exists
Created database 'db/test.sqlite3'
/opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74: warning: ⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment.  Your jobs will not go to Redis.
bin/rails aborted!
ArgumentError: missing keyword: :account (ArgumentError)
/akkounts/app/services/create_account.rb:2:in `initialize'
/akkounts/app/services/application_service.rb:5:in `new'
/akkounts/app/services/application_service.rb:5:in `call'
/akkounts/db/seeds.rb:6:in `block in <top (required)>'
/akkounts/db/seeds.rb:5:in `<top (required)>'
Tasks: TOP => db:setup => db:seed
(See full trace by running task with --trace)

However, when I go to http://localhost:3000 I get the Kosmos login page, but admin pw: admin is admin does not work.

Not sure if this is relevant, or the right container to look at (I also checked the LDAP container which had nothing that looked relevant):

$ docker logs akkounts-web-1 
...
12:13:09 web.1  | Started POST "/users/sign_in" for 172.26.0.1 at 2024-02-22 12:13:09 +0000
12:13:09 web.1  |    (1.0ms)  SELECT "flipper_features"."key" AS feature_key, "flipper_gates"."key", "flipper_gates"."value" FROM "flipper_features" LEFT OUTER JOIN "flipper_gates" ON "flipper_features"."key" = "flipper_gates"."feature_key"
12:13:09 web.1  | Processing by Devise::SessionsController#create as TURBO_STREAM
12:13:09 web.1  |   Parameters: {"authenticity_token"=>"hxKOWHhE30Vc9tg0955Hgze5eaX9iSMj-MfGovDHyyzrR5dSeGMrUBVNG_A0PZfAbrIvZe0WsKTnAb5KCL66VA", "user"=>{"cn"=>"admin", "password"=>"[FILTERED]", "remember_me"=>"false"}, "commit"=>"Log in"}
12:13:09 web.1  |   User Load (0.5ms)  SELECT "users".* FROM "users" WHERE "users"."cn" = ? ORDER BY "users"."id" ASC LIMIT ?  [["cn", "admin"], ["LIMIT", 1]]
12:13:09 web.1  |   LDAP: LDAP dn lookup: cn=admin
12:13:09 web.1  |   LDAP: LDAP search for login: cn=admin
12:13:09 web.1  |   LDAP: LDAP search yielded 0 matches
12:13:09 web.1  |   LDAP: Authorizing user cn=admin,ou=kosmos.org,cn=users,dc=kosmos,dc=org
12:13:09 web.1  |   LDAP: Not authorized because not authenticated.
12:13:09 web.1  |   LDAP: LDAP dn lookup: cn=admin
12:13:09 web.1  |   LDAP: LDAP search for login: cn=admin
12:13:09 web.1  |   LDAP: LDAP search yielded 0 matches
12:13:09 web.1  |   LDAP: Authorizing user cn=admin,ou=kosmos.org,cn=users,dc=kosmos,dc=org
12:13:09 web.1  |   LDAP: Not authorized because not authenticated.
12:13:09 web.1  | Completed 401 Unauthorized in 320ms (ActiveRecord: 0.5ms | Allocations: 16238)
12:13:09 web.1  | 
12:13:09 web.1  | 
12:13:09 web.1  | Processing by Devise::SessionsController#new as TURBO_STREAM
12:13:09 web.1  |   Parameters: {"authenticity_token"=>"hxKOWHhE30Vc9tg0955Hgze5eaX9iSMj-MfGovDHyyzrR5dSeGMrUBVNG_A0PZfAbrIvZe0WsKTnAb5KCL66VA", "user"=>{"cn"=>"admin", "password"=>"[FILTERED]", "remember_me"=>"false"}, "commit"=>"Log in"}
12:13:09 web.1  |   Rendering layout layouts/application.html.erb
12:13:09 web.1  |   Rendering devise/sessions/new.html.erb within layouts/application
12:13:09 web.1  |   Rendered devise/shared/_error_messages.html.erb (Duration: 0.0ms | Allocations: 11)
12:13:09 web.1  | WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value.
12:13:09 web.1  |   Rendered devise/sessions/new.html.erb within layouts/application (Duration: 7.5ms | Allocations: 1434)
12:13:09 web.1  |   Rendered shared/icons/_comet.html.erb (Duration: 0.0ms | Allocations: 9)
12:13:09 web.1  |   Rendered icons/_alert-octagon.html.erb (Duration: 0.0ms | Allocations: 8)
12:13:09 web.1  |   Rendered layout layouts/application.html.erb (Duration: 12.7ms | Allocations: 3371)
12:13:09 web.1  | Completed 200 OK in 14ms (Views: 13.3ms | ActiveRecord: 0.0ms | Allocations: 3809)
12:13:09 web.1  | 
12:13:09 web.1  | 
Yeah, I checked the logs and nothing looked bad that I noticed. Carrying on with the instructions from the README: ```bash $ docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev" The database was sucessfully created $ docker compose run web rails ldap:setup [+] Creating 2/0 ✔ Container akkounts-ldap-1 Running 0.0s ✔ Container akkounts-redis-1 Running 0.0s WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value. WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value. WARNING: table: "settings" does not exist or not database connection, `Setting.reserved_usernames` fallback to returns the default value. Deleting entry: cn=admin_role,ou=kosmos.org,cn=users,dc=kosmos,dc=org false Adding entry: dc=kosmos,dc=org Adding entry: cn=users,dc=kosmos,dc=org Adding entry: ou=kosmos.org,cn=users,dc=kosmos,dc=org Adding entry: cn=admin_role,ou=kosmos.org,cn=users,dc=kosmos,dc=org $ docker compose run web rails db:setup [+] Creating 2/0 ✔ Container akkounts-ldap-1 Running 0.0s ✔ Container akkounts-redis-1 Running 0.0s WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value. WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value. WARNING: table: "settings" does not exist or not database connection, `Setting.reserved_usernames` fallback to returns the default value. Database 'db/development.sqlite3' already exists Created database 'db/test.sqlite3' /opt/rubies/ruby-3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74: warning: ⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis. bin/rails aborted! ArgumentError: missing keyword: :account (ArgumentError) /akkounts/app/services/create_account.rb:2:in `initialize' /akkounts/app/services/application_service.rb:5:in `new' /akkounts/app/services/application_service.rb:5:in `call' /akkounts/db/seeds.rb:6:in `block in <top (required)>' /akkounts/db/seeds.rb:5:in `<top (required)>' Tasks: TOP => db:setup => db:seed (See full trace by running task with --trace) ``` However, when I go to `http://localhost:3000` I get the Kosmos login page, but `admin` pw: `admin is admin` does not work. Not sure if this is relevant, or the right container to look at (I also checked the LDAP container which had nothing that looked relevant): ```bash $ docker logs akkounts-web-1 ... 12:13:09 web.1 | Started POST "/users/sign_in" for 172.26.0.1 at 2024-02-22 12:13:09 +0000 12:13:09 web.1 | (1.0ms) SELECT "flipper_features"."key" AS feature_key, "flipper_gates"."key", "flipper_gates"."value" FROM "flipper_features" LEFT OUTER JOIN "flipper_gates" ON "flipper_features"."key" = "flipper_gates"."feature_key" 12:13:09 web.1 | Processing by Devise::SessionsController#create as TURBO_STREAM 12:13:09 web.1 | Parameters: {"authenticity_token"=>"hxKOWHhE30Vc9tg0955Hgze5eaX9iSMj-MfGovDHyyzrR5dSeGMrUBVNG_A0PZfAbrIvZe0WsKTnAb5KCL66VA", "user"=>{"cn"=>"admin", "password"=>"[FILTERED]", "remember_me"=>"false"}, "commit"=>"Log in"} 12:13:09 web.1 | User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."cn" = ? ORDER BY "users"."id" ASC LIMIT ? [["cn", "admin"], ["LIMIT", 1]] 12:13:09 web.1 | LDAP: LDAP dn lookup: cn=admin 12:13:09 web.1 | LDAP: LDAP search for login: cn=admin 12:13:09 web.1 | LDAP: LDAP search yielded 0 matches 12:13:09 web.1 | LDAP: Authorizing user cn=admin,ou=kosmos.org,cn=users,dc=kosmos,dc=org 12:13:09 web.1 | LDAP: Not authorized because not authenticated. 12:13:09 web.1 | LDAP: LDAP dn lookup: cn=admin 12:13:09 web.1 | LDAP: LDAP search for login: cn=admin 12:13:09 web.1 | LDAP: LDAP search yielded 0 matches 12:13:09 web.1 | LDAP: Authorizing user cn=admin,ou=kosmos.org,cn=users,dc=kosmos,dc=org 12:13:09 web.1 | LDAP: Not authorized because not authenticated. 12:13:09 web.1 | Completed 401 Unauthorized in 320ms (ActiveRecord: 0.5ms | Allocations: 16238) 12:13:09 web.1 | 12:13:09 web.1 | 12:13:09 web.1 | Processing by Devise::SessionsController#new as TURBO_STREAM 12:13:09 web.1 | Parameters: {"authenticity_token"=>"hxKOWHhE30Vc9tg0955Hgze5eaX9iSMj-MfGovDHyyzrR5dSeGMrUBVNG_A0PZfAbrIvZe0WsKTnAb5KCL66VA", "user"=>{"cn"=>"admin", "password"=>"[FILTERED]", "remember_me"=>"false"}, "commit"=>"Log in"} 12:13:09 web.1 | Rendering layout layouts/application.html.erb 12:13:09 web.1 | Rendering devise/sessions/new.html.erb within layouts/application 12:13:09 web.1 | Rendered devise/shared/_error_messages.html.erb (Duration: 0.0ms | Allocations: 11) 12:13:09 web.1 | WARNING: table: "settings" does not exist or not database connection, `Setting.primary_domain` fallback to returns the default value. 12:13:09 web.1 | Rendered devise/sessions/new.html.erb within layouts/application (Duration: 7.5ms | Allocations: 1434) 12:13:09 web.1 | Rendered shared/icons/_comet.html.erb (Duration: 0.0ms | Allocations: 9) 12:13:09 web.1 | Rendered icons/_alert-octagon.html.erb (Duration: 0.0ms | Allocations: 8) 12:13:09 web.1 | Rendered layout layouts/application.html.erb (Duration: 12.7ms | Allocations: 3371) 12:13:09 web.1 | Completed 200 OK in 14ms (Views: 13.3ms | ActiveRecord: 0.0ms | Allocations: 3809) 12:13:09 web.1 | 12:13:09 web.1 | ```
raucao added 1 commit 2024-02-22 12:25:11 +00:00
Fix seeds for new keyword argument
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 3s
56d91083e5
Author
Owner

Hooray, almost there! Things are all working as intended now.

You have found an actual bug in the seeds, which was created by my changes to the code in the original PR, i.e. a successful review. 💪

If you pull my latest commit and run the db:setup again, it should work this time.

Hooray, almost there! Things are all working as intended now. You have found an actual bug in the seeds, which was created by my changes to the code in the original PR, i.e. a successful review. 💪 If you pull my latest commit and run the `db:setup` again, it should work this time.
Author
Owner

@slvrbckt You could approve this PR already, because it's confirmed to do what it says. So then I can merge it, and leave the other fix for the original PR review.

@slvrbckt You could approve this PR already, because it's confirmed to do what it says. So then I can merge it, and leave the other fix for the original PR review.
raucao added the
kredits-1
label 2024-02-22 13:51:21 +00:00
raucao removed review request for galfert 2024-02-22 13:51:23 +00:00
slvrbckt approved these changes 2024-02-22 14:09:01 +00:00
slvrbckt left a comment
Owner

Working now! 👍

Working now! 👍
raucao merged commit 4581900427 into chore/update_dependencies 2024-02-22 14:12:05 +00:00
raucao deleted branch chore/fix_docker_ruby_on_apple_silicon 2024-02-22 14:12:05 +00:00
Owner

I can confirm as that his fixes the segfaults for me. Thank you 🥇

I'm still seeing the directory permission errors though. When I comment out the volumes config on the redis service, I'm getting the same error for the volumes of the other services (ldap and minio). But when I comment out all three of them, docker starts up without any further errors.

I can confirm as that his fixes the segfaults for me. Thank you 🥇 I'm still seeing the directory permission errors though. When I comment out the `volumes` config on the redis service, I'm getting the same error for the volumes of the other services (ldap and minio). But when I comment out all three of them, docker starts up without any further errors.
Author
Owner

Would be interesting to know why that isn't happening for @slvrbckt on the same platform and OS (albeit probably not with the alternative Docker implementation).

The LDAP one might actually make sense to not even mount, but the minio volume is incredibly convenient for browsing data in RS accounts on the host filesystem.

Would be interesting to know why that isn't happening for @slvrbckt on the same platform and OS (albeit probably not with the alternative Docker implementation). The LDAP one might actually make sense to not even mount, but the minio volume is incredibly convenient for browsing data in RS accounts on the host filesystem.
Author
Owner

@galfert Could you try and see if using named volumes fixes the issues? I just opened #171 for that.

@galfert Could you try and see if using named volumes fixes the issues? I just opened #171 for that.
Sign in to join this conversation.
No description provided.