Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
16
Issue boards
Milestones
Wiki
Code
Merge requests
10
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rc
rabbitmq_agents
Commits
d45dc138
Commit
d45dc138
authored
1 month ago
by
Krish Moodbidri
Browse files
Options
Downloads
Patches
Plain Diff
added initial instructions to setup and configure rabbitmq on a standalone vm (alma9) on openstack
parent
a3ca071c
No related branches found
Branches containing commit
No related tags found
1 merge request
!156
Update README with improvements and corrections
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+118
-75
118 additions, 75 deletions
README.md
with
118 additions
and
75 deletions
README.md
+
118
−
75
View file @
d45dc138
...
@@ -49,112 +49,155 @@ This project automates user registration workflows at UAB using **RabbitMQ** to
...
@@ -49,112 +49,155 @@ This project automates user registration workflows at UAB using **RabbitMQ** to
###
Prerequisites
###
Prerequisites
-
macOS
*
Launch
an
alma
9
instance
on
openstack,
ssh
into
it
and
run
the
following
commands
-
Homebrew
*Before
proceeding,
set
these
environment
variables:*
```
-
Python
3
.x
export RABBITMQ_USER="reggie" # RabbitMQ admin username
export RABBITMQ_PASSWORD="secure_password" # RabbitMQ admin password
export CELERY_VHOST="adduser" # Celery-dedicated vhost
export CELERY_USER="celery_user" # Celery service username
export CELERY_PASSWORD="celery_pass" # Celery service password
```
### 1.1 Configure Package Repositories
###
Install
and
Setup
RabbitMQ
# Import security keys
sudo rpm --import https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
sudo rpm --import https://packagecloud.io/rabbitmq/erlang/gpgkey
sudo rpm --import https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
```
bash
# Erlang Repository (AlmaLinux 8)
brew update
```
brew install rabbitmq
sudo tee /etc/yum.repos.d/rabbitmq_erlang.repo <<'EOL'
[rabbitmq_erlang]
name=RabbitMQ Erlang
baseurl=https://packagecloud.io/rabbitmq/erlang/el/8/$basearch
gpgcheck=1
gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey
https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
enabled=1
EOL
```
```
For CentOS, refer to:
- [RabbitMQ Role Configuration](https://github.com/jprorama/CRI_XCBC/blob/dev/roles/ohpc_rabbitmq/tasks/main.yaml)
# RabbitMQ Server Repository
```
- [VHost Configuration](https://github.com/jprorama/CRI_XCBC/blob/dev/roles/ohpc_add_rabbitmq_agents/tasks/main.yaml)
sudo tee /etc/yum.repos.d/rabbitmq_server.repo <<'EOL'
[rabbitmq_server]
name=RabbitMQ Server
baseurl=https://packagecloud.io/rabbitmq/rabbitmq-server/el/8/$basearch
gpgcheck=1
gpgkey=https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey
enabled=1
EOL
```
###
Add RabbitMQ to Your PATH
###
1.2 Install Packages
```
```
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
sudo yum install -y socat logrotate
source ~/.zshrc # Reload your shell to apply changes
sudo yum install -y erlang-25.3.2 rabbitmq-server-3.12.6
sudo systemctl enable --now rabbitmq-server
```
```
### install centos steps
https://github.com/jprorama/CRI_XCBC/blob/dev/roles/ohpc_rabbitmq/tasks/main.yaml
and the 2 vhosts
https://github.com/jprorama/CRI_XCBC/blob/dev/roles/ohpc_add_rabbitmq_agents/tasks/main.yaml
### Start RabbitMQ
## 2. RabbitMQ Configuration
### 2.1 Create Admin User & Permissions
```
```
brew services start rabbitmq
sudo rabbitmqctl add_user $RABBITMQ_USER $RABBITMQ_PASSWORD
sudo rabbitmqctl set_user_tags $RABBITMQ_USER administrator
sudo rabbitmqctl set_permissions -p / $RABBITMQ_USER ".
*" ".*
" ".
*
"
```
```
### Check RabbitMQ Status
### 2.2 Configure Celery Environment
```
```
rabbitmqctl status
sudo rabbitmqctl add_vhost $CELERY_VHOST
sudo rabbitmqctl add_user $CELERY_USER $CELERY_PASSWORD
sudo rabbitmqctl set_permissions -p $CELERY_VHOST $CELERY_USER ".
*" ".*
" ".
*
"
```
```
### Create Config File
## 3. Agent Service Setup
### 3.1 Deploy Agent Codebase
```
```
echo '[{rabbit, [{loopback_users, []}]}].' | sudo tee /etc/rabbitmq/rabbitmq.config
AGENT_DIR="/cm/shared/rabbitmq_agents"
sudo chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq.config
sudo git clone https://gitlab.rc.uab.edu/rc/rabbitmq_agents.git $AGENT_DIR
sudo chmod 644 /etc/rabbitmq/rabbitmq.config
cd $AGENT_DIR
sudo git checkout main # Or specific commit/tag
```
```
### Restart Service
### 3.2 Configure Python Environment
```
```
sudo systemctl restart rabbitmq-server
sudo python3 -m venv $AGENT_DIR/venv
sudo $AGENT_DIR/venv/bin/pip install -r $AGENT_DIR/requirements.txt
```
```
###
Access the Management UI
###
3.3 Create Agent Configuration
- **URL**: [http://localhost:15672](http://localhost:15672/)
Create `$AGENT_DIR/rabbit_config.py` with:
- **Credentials**:
```
# rabbit_config.py
- Username: `guest`
host = 'localhost' # Or your cluster host
port = 5672
- Password: `guest`
vhost = '$CELERY_VHOST' # Use actual vhost name
user = '$CELERY_USER' # Celery username
password = '$CELERY_PASSWORD'
```
###
Add Vhost in **rabbit_config.py**
###
3.4 Systemd Service Setup
```
```
RABBITMQ = {
sudo tee /etc/systemd/system/ood_account_agent.service <<'EOL'
'HOST': 'localhost',
[Unit]
'PORT': 5672,
Description=User Account Agent
'VHOST': 'adduser',
After=rabbitmq-server.service
'USER': 'reggie',
'PASSWORD': 'reggie'
[Service]
}
Type=simple
User=root
WorkingDirectory=/cm/shared/rabbitmq_agents
ExecStart=/cm/shared/rabbitmq_agents/venv/bin/python agent_main.py
Restart=on-failure
Environment="PYTHONUNBUFFERED=1"
[Install]
WantedBy=multi-user.target
EOL
sudo systemctl daemon-reload
sudo systemctl enable --now ood_account_agent
```
```
### Add Celery Vhost
## 4. Network Configuration
### Disable Firewall (Testing Only)
```
```
rabbitmqctl add_vhost adduser
sudo systemctl stop firewalld
rabbitmqctl add_user reggie reggie
sudo systemctl disable firewalld
rabbitmqctl set_permissions -p adduser reggie ".
*" ".*
" ".
*
"
```
```
### WIP Configuration Steps
## 5. Validation & Testing
```
# Verify Services
systemctl is-active rabbitmq-server ood_account_agent
# Check RabbitMQ Users
sudo rabbitmqctl list_users
# Inspect Agent Logs
journalctl -u ood_account_agent -f --since "5m ago"
```
1. **Bind Queues to `RegUsr` Exchange**:
Use these routing keys:
- `request<queuename>`
- `completed<queuename>`
- `verify<queuename>`
_(Replace `<queuename>` with your queue’s name, e.g., `request_user_reg`)_
2. **Deploy Agents**:
- Run the Web UI (`self_reg_app`) for user submissions.
- Execute `create_account.py` to process tasks (e.g., UID assignment).
3. **Monitor Queues**:
Use RabbitMQ’s management UI or CLI tools to check:
- `task_manager` for workflow progress.
- `notify user` for delivery status of emails/SMS.
----------
## Error Handling
## Error Handling
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment