New Developer Setup
Requirements Summary
| Name | Min Version | Max Version |
|---|---|---|
| Ruby | 3.1.3 | 3.4.x |
| Bundler | 2.2.15 | 2.x |
| NodeJS | 20.19.1 | 20.x.x |
| Python | 3.9.x | |
| PostgreSQL | 13.x | 16.x |
| Java | 11.x | 19.x |
| Kafka | 3.3.1 |
Prerequisites
System packages
-
In order to compile Ruby, install the header files for OpenSSL, readline and zlib.
dnf sudo dnf -y install openssl-devel readline-devel zlib-develyum sudo yum -y install openssl-devel readline-devel zlib-develapt sudo apt -y install libssl-dev libreadline-dev zlib1g-devbrew brew install openssl -
In addition, in order to compile Ruby, native Gems and native NodeJS modules, other libraries are required.
dnf sudo dnf -y install @c-development libffi-devel postgresql-devel libxml2-devel libcurl-devel cmake python libssh2-develyum sudo yum -y install @development libffi-devel postgresql-devel libxml2-devel libcurl-devel cmake python libssh2-develapt sudo apt -y install build-essential libffi-dev libpq-dev libxml2-dev libcurl4-openssl-dev cmake python libssh2-1-devbrew brew install cmake libssh2 iproute2mac ansibleOn Fedora 41+ you have to also run
sudo dnf install -y openssl-devel-engineOn the mac,iproute2macprovides theipcommand forappliance_console.Note: Users with MacOS running on Apple M1 CPU might need to specify location of the
Homebrewlibraries explicitly. If build steps below fail for you then runexport LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"and retry the failing build step. See here for additional information: https://github.com/Homebrew/brew/issues/13481
Services
ManageIQ requires a memcached instance for session caching and a PostgreSQL database for persistent data storage.
memcached
-
Install
dnf sudo dnf -y install memcachedyum sudo yum -y install memcachedapt sudo apt -y install memcachedbrew brew install memcachedcontainers N/A -
Start the service
systemd systemctl enable --now memcachedbrew brew services start memcachedcontainers podman run --detach --publish 11211:11211 memcached
PostgreSQL
-
Install
dnf sudo dnf -y install postgresql-serveryum sudo yum -y install postgresql-serverapt sudo apt -y install postgresqlbrew brew install postgresql@13containers N/A -
Configure and start the cluster
-
Fedora / CentOS
sudo PGSETUP_INITDB_OPTIONS='--auth trust --username root --encoding UTF-8' postgresql-setup --initdb -
Debian / Ubuntu
pg_version=$(pg_lsclusters --no-header | awk '{print $1}' | sort -n | tail -1) sudo pg_dropcluster --stop $pg_version main sudo pg_createcluster -e UTF-8 -l C $pg_version main -- --auth trust --username root sudo pg_ctlcluster $pg_version main start -
macOS
brewwill configure the cluster automatically, but you will need to create the user.brew services start postgresql@13 psql -c "CREATE USER root SUPERUSER PASSWORD 'smartvm';" -U $USER -d template1If not using brew, you can configure a cluster using
initdbdirectly.rm -rf /usr/local/var/postgres initdb --auth trust --username root --encoding UTF-8 /usr/local/var/postgres -
containers
Skip ahead to “Start the service”
-
-
Start the service
systemd systemctl enable --now postgresqlbrew Already started above containers podman run --detach --publish 5432:5432 --env POSTGRES_USER=root postgres
Kafka
-
Install
dnf sudo dnf -y install kafkayum sudo yum -y install kafkaapt sudo apt -y install kafkabrew brew install java kafkacontainers N/A -
Configure the service
- macOS
-
Configure system to use Java
sudo ln -sfn $(brew --prefix)/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk -
Configure KRaft (optional, if not using zookeeper)
mv $(brew --prefix)/etc/kafka/server.properties $(brew --prefix)/etc/kafka/server.properties-zookeeper ln -s $(brew --prefix)/etc/kafka/kraft/server.properties $(brew --prefix)/etc/kafka/ kafka-storage format -t $(kafka-storage random-uuid) -c $(brew --prefix)/etc/kafka/server.properties
-
- macOS
-
Start the service
systemd systemctl enable --now kafkabrew brew services start kafka,brew services start zookeeper
nvm and JavaScript build utilities
nvm is strongly recommended for NodeJS version management.
nvm install 20
nvm use 20
# Set version 20 as the default for all scripts
nvm alias default 20
You may need to restart your shell in order to source the nvm initialization environment.
Then install yarn - you can find the recommended way for your platform at https://classic.yarnpkg.com/en/docs/install, or, if that fails, via npm.
npm install --global yarn
Ruby and Bundler
A Ruby version manager is strongly recommended. Use any one of the following:
Using the Ruby version manager, install Ruby and the latest bundler (as listed in the Requirements Summary above).
Clone ManageIQ
You must first fork the repository, clone it and then create an upstream remote. Additionally, to run the following commands you will need to setup an SSH key. Detailed instructions on how to do (as well as set up the recommended git and GitHub options) can be found in Git workflow.
git clone git@github.com:<username>/manageiq.git
cd manageiq
git remote add upstream git@github.com:ManageIQ/manageiq.git
git fetch upstream
Configure ManageIQ
A setup script is available to quickly set up the application. This script installs the required Gems, sets up necessary JavaScript libraries, creates and migrates the database, and finally seeds the database with initial content.
bin/setup
NOTE
-
macOS requires platform specific Gems. Run
bundle config specific_platform truebefore runningbin/setup. -
If you’ve run PostgreSQL in a container, be sure to export the
DATABASE_URLvariable to connect to the container over TCP instead of a UNIX file socket.export DATABASE_URL='postgresql://localhost:5432' # optional, only necessary if PostgreSQL is running in a container
Start ManageIQ
bundle exec rails server
The web UI should now be available at http://localhost:3000. The default username is admin and the default password is smartvm. If you can login, then everything is working! Press Ctrl-C to stop the Rails server.
ManageIQ runs a lot of work asynchronously via background queue workers, to simulate this we recommend running:
bundle exec rails console
simulate_queue_worker
macOS AirDrop & Handoff Listens on Port 5000
If you run workers like we do on appliances using ruby lib/workers/bin/evm_server.rb, remote console workers will try to bind to port 5000. This can fail on macOS with:
Address already in use - bind(2) for "0.0.0.0" port 5000
This is because the AirPlay Receiver on macOS listens on port 5000. You can disable this feature here:
System Settings > General > AirDrop & Handoff > AirPlay Receiver.
Alternatively, you can use foreman to start workers.
Further Reading
- Individual workers can be started using Foreman directly.
- Running the test suites
- Seeding inventory data from provider tests
- Provider, UI and plugin development describes the plugin and external provider development process.
- ManageIQ Bot a bot to automate various developer problems such as commit monitoring, Github pull request and Travis monitoring.