Installation

Installation

ℹ️

ACIOps is supported on ACI Fabric version 5.0 and later.

To get started locally, you will need to have a few things:

    • A Linux VM with docker and docker compose installed.
    • Access to the internet to download container images from Dockerhub.

There are 3 containers that will be required and 2 optional containers.

    • aciops-ui
    • aciops-server
    • aciops-db
    • terraform-server - Optional**
    • gitlab - Optional**

** The terraform-server or gitlab is not required if:

  • Terraform - You do not require the ACI as Code feature.
  • Terraform - You already have a server installed with Terraform.
  • Gitlab - You do not require the your configurations to be pushed to Gitlab, hence, saved locally.
  • Gitlab - You already have a Gitlab instance.

The terraform deployment requires a Dockerfile to build the image before it is deployed. Below is the docker-compose.yml and the Dockerfile for the entire deployment. Based on your requirement, you could delete the terraform or gitlab sections.

docker-compose.yaml
networks:
  aciops_network:
 
services:
# <--- SECTION ACIOPS-UI --->
  aciops-ui:
    image: infratocode/aciops-ui:1.0.0
    container_name: aciops-ui
    networks:
      - aciops_network
    depends_on:
      aciops-server:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost"]
      interval: 30s
      retries: 10
      timeout: 20s
      start_period: 10s
    environment:
      - BACKEND_URL=http://aciops-server:5000
    ports:
      - 443:443
      - 80:80
 
 
# <--- SECTION ACIOPS-SERVER --->
  aciops-server:
    image: infratocode/aciops-server:1.0.0
    container_name: aciops-server
    networks:
      - aciops_network
    depends_on:
      aciops-db:
        condition: service_healthy
        restart: true
    healthcheck:
      test: ["CMD", "curl", "-d", "'{}'", "-X", "POST", "http://localhost:5000/api/v1/authentication/login"]
      interval: 30s
      retries: 5
      start_period: 10s
      timeout: 10s 
    environment:
      - POSTGRES_IP=aciops-db
      - POSTGRES_PORT=5432
    volumes:
      - ./server/ssh:/root/.ssh
    ports:
      - 5000:5000
 
 
# <--- SECTION ACIOPS-DB --->
  aciops-db:
    image: infratocode/aciops-db:1.0.0
    container_name: aciops-db
    networks:
      - aciops_network
    volumes:
      - ./postgres:/var/lib/postgresql/data
    ports:
      - 5432:5432
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
      interval: 10s
      retries: 5
      start_period: 30s
      timeout: 10s
 
 
# <--- SECTION TERRAFORM SERVER - OPTIONAL --->
  terraform:
    build:
      context: .
      dockerfile: Dockerfile
    image: terraform
    networks:
      - aciops_network
    healthcheck:
      test: ["CMD", "ls"]
      interval: 30s
      retries: 10
      timeout: 20s
      start_period: 10s
    restart: always
    volumes:
      - ./terraform:/terraform
      - ./server/ssh:/root/.ssh
    container_name: terraform
    working_dir: /terraform
    ports:
      - "2222:22"
 
 
# <--- SECTION GITLAB - OPTIONAL --->
  gitlab:
    image: gitlab/gitlab-ce
    container_name: gitlab
    restart: always
    networks:
      - aciops_network
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost/-/health"]
      interval: 30s
      retries: 10
      timeout: 20s
      start_period: 10s
    environment:
      GITLAB_ROOT_PASSWORD: Ch@ng3Th!sP@ssw0rd
      GITLAB_OMNIBUS_CONFIG: |
        puma['worker_processes'] = 0
    ports:
      - "8080:80"
      - "4431:443"
      - "2221:22"
    volumes:
      - "./gitlab/config:/etc/gitlab"
      - "./gitlab/logs:/var/log/gitlab"
      - "./gitlab/data:/var/opt/gitlab"
 
Dockerfile
 
# Use Debian as the base image
FROM debian:latest
 
# Set environment variables for non-interactive installations
ENV DEBIAN_FRONTEND=noninteractive
ENV ROOT_PASSWORD=root
 
# Update package list and install required packages
RUN apt-get update && \
    apt-get install -y \
    openssh-server \
    wget \
    unzip \
    lsb-release \
    gnupg \
    gnupg2 \
    software-properties-common \
    sudo && \
    apt-get clean
 
# Add the HashiCorp GPG key and Terraform repository
RUN wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg && \
    echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list
 
# Install Terraform
RUN apt-get update && apt-get install -y terraform
 
# Configure SSH server and root password
RUN mkdir /var/run/sshd && \
    echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config && \
    echo 'PasswordAuthentication yes' >> /etc/ssh/sshd_config && \
    echo "root:${ROOT_PASSWORD}" | chpasswd
 
# Expose SSH port
EXPOSE 22
 
# Start SSH server
CMD ["/usr/sbin/sshd", "-D"]
 
    • Create a file named docker-compose.yaml and insert the provided docker-compose configuration into this file.
    • Create a file named Dockerfile and insert the provided Dockerfile configuration into this file.

The directory should initially look like the tree map below.


directory/
├── Dockerfile
└── docker-compose.yaml
ℹ️

The POSTGRES_USERNAME and POSTGRES_PASSWORD environment variables have been preconfigured. If you wish to modify these credentials, please ensure that the changes are reflected in both the aciops-server and aciops-db configurations.

ℹ️

The POSTGRES_IP and POSTGRES_PORT environment variables have been preconfigured. These settings may be adjusted to accommodate specific environmental requirements or to use explicit IP addresses and port numbers.

ℹ️

The aciops-server container has a volume declaration to store the ssh keys. This is not required but could be useful when recreating the container without having to recreate the ssh keys.

    • Run the command docker-compose up -d --build to download and instantiate all the containers.
user@machine:~$ docker ps -a
CONTAINER ID   IMAGE                         COMMAND                  CREATED         STATUS                          PORTS                                                                                    NAMES
fbc9ba8be084   infratocode/aciops-ui       "/docker-entrypoint.…"   8 hours ago   Up 8 hours (healthy)   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp                                                      aciops-ui
e12f21715617   infratocode/aciops-server   "/bin/bash -c 'sourc…"   8 hours ago   Up 8 hours (healthy)   0.0.0.0:5000->5000/tcp, :::5000->5000/tcp                                                                                     aciops-server
f1bbe4b85c94   infratocode/aciops-db       "docker-entrypoint.s…"   8 hours ago   Up 8 hours (healthy)   0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                                                                     aciops-db
af779aecf0b9   gitlab/gitlab-ce             "/assets/wrapper"        8 hours ago   Up 8 hours (healthy)   0.0.0.0:2221->22/tcp, [::]:2221->22/tcp, 0.0.0.0:8081->80/tcp, [::]:8081->80/tcp, 0.0.0.0:4431->443/tcp, [::]:4431->443/tcp   gitlab
a06a282a81e1   terraform                    "/usr/sbin/sshd -D"      8 hours ago   Up 8 hours (healthy)   0.0.0.0:2222->22/tcp, [::]:2222->22/tcp                                                                                       terraform

Once all containers are operational and healthy, you should be able to access the ACIOps UI by navigating to the VM’s address via https.

ACIOps Login Page