-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nautobot/min-max-rules
added min max rules model, api, and tests
- Loading branch information
Showing
29 changed files
with
1,841 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
|
||
ARG python_ver=3.7 | ||
FROM python:${python_ver} | ||
ARG PYTHON_VER | ||
ARG NAUTOBOT_VER | ||
FROM ghcr.io/nautobot/nautobot-dev:${NAUTOBOT_VER}-py${PYTHON_VER} | ||
|
||
ARG nautobot_ver=v1.0.0b1 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN mkdir /prom_cache | ||
ENV prometheus_multiproc_dir /prom_cache | ||
|
||
RUN mkdir -p /opt/nautobot | ||
|
||
RUN pip install --upgrade pip\ | ||
&& pip install poetry | ||
WORKDIR /source | ||
|
||
# ------------------------------------------------------------------------------------- | ||
# Install Nautobot | ||
# ------------------------------------------------------------------------------------- | ||
COPY packages/nautobot-1.0.0b1-py3-none-any.whl /tmp | ||
RUN pip install /tmp/nautobot-1.0.0b1-py3-none-any.whl | ||
# Copy in only pyproject.toml/poetry.lock to help with caching this layer if no updates to dependencies | ||
COPY poetry.lock pyproject.toml /source/ | ||
# --no-root declares not to install the project package since we're wanting to take advantage of caching dependency installation | ||
# and the project is copied in and installed after this step | ||
RUN poetry install --no-interaction --no-ansi --no-root | ||
|
||
# ------------------------------------------------------------------------------------- | ||
# Install Nautobot Plugin | ||
# ------------------------------------------------------------------------------------- | ||
RUN mkdir -p /source | ||
WORKDIR /source | ||
# Copy in the rest of the source code and install local Nautobot plugin | ||
COPY . /source | ||
RUN poetry config virtualenvs.create false \ | ||
&& poetry install --no-interaction --no-ansi | ||
RUN poetry install --no-interaction --no-ansi | ||
|
||
ENV NAUTOBOT_CONFIG /opt/nautobot/configuration.py | ||
WORKDIR /opt/nautobot/ | ||
COPY development/nautobot_config.py /opt/nautobot/nautobot_config.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
ALLOWED_HOSTS=* | ||
CHANGELOG_RETENTION=0 | ||
DB_HOST=postgres | ||
DB_NAME=nautobot | ||
DB_PASSWORD=decinablesprewad | ||
DB_USER=nautobot | ||
HIDE_RESTRICTED_UI=True | ||
MAX_PAGE_SIZE=0 | ||
NAPALM_TIMEOUT=5 | ||
NAUTOBOT_CONFIG=/etc/nautobot/nautobot_config.py | ||
NAUTOBOT_ALLOWED_HOSTS=* | ||
NAUTOBOT_CHANGELOG_RETENTION=0 | ||
NAUTOBOT_CONFIG=/opt/nautobot/nautobot_config.py | ||
NAUTOBOT_DB_HOST=postgres | ||
NAUTOBOT_DB_NAME=nautobot | ||
NAUTOBOT_DB_PASSWORD=decinablesprewad | ||
NAUTOBOT_DB_USER=nautobot | ||
NAUTOBOT_MAX_PAGE_SIZE=0 | ||
NAUTOBOT_NAPALM_TIMEOUT=5 | ||
NAUTOBOT_REDIS_HOST=redis | ||
NAUTOBOT_REDIS_PASSWORD=decinablesprewad | ||
NAUTOBOT_REDIS_PORT=6379 | ||
# Uncomment REDIS_SSL if using SSL | ||
# NAUTOBOT_REDIS_SSL=True | ||
NAUTOBOT_SECRET_KEY=012345678901234567890123456789012345678901234567890123456789 | ||
|
||
# Needed for Postgres should match the values for Nautobot above | ||
PGPASSWORD=decinablesprewad | ||
POSTGRES_DB=nautobot | ||
POSTGRES_PASSWORD=decinablesprewad | ||
POSTGRES_USER=nautobot | ||
REDIS_HOST=redis | ||
|
||
# Needed for Redis should match the values for Nautobot above | ||
REDIS_PASSWORD=decinablesprewad | ||
REDIS_PORT=6379 | ||
# Uncomment REDIS_SSL if using SSL | ||
# REDIS_SSL=True | ||
SECRET_KEY=012345678901234567890123456789012345678901234567890123456789 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,59 @@ | ||
|
||
--- | ||
version: "3" | ||
services: | ||
nautobot: | ||
x-nautobot-build: &nautobot-build | ||
build: | ||
args: | ||
NAUTOBOT_VER: "${NAUTOBOT_VER}" | ||
PYTHON_VER: "${PYTHON_VER}" | ||
context: "../" | ||
dockerfile: "development/Dockerfile" | ||
image: "nautobot-data-validation-engine/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" | ||
command: > | ||
sh -c "nautobot-server migrate && | ||
nautobot-server runserver 0.0.0.0:8000" | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- "postgres" | ||
- "redis" | ||
x-nautobot-base: &nautobot-base | ||
image: "nautobot_data_validation_engine/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" | ||
env_file: | ||
- "./dev.env" | ||
volumes: | ||
- "./nautobot_config.py:/etc/nautobot/nautobot_config.py" | ||
- "../:/source" | ||
- "dev.env" | ||
tty: true | ||
worker: | ||
build: | ||
context: "../" | ||
dockerfile: "development/Dockerfile" | ||
image: "nautobot-data-validation-engine/nautobot:${NAUTOBOT_VER}-py${PYTHON_VER}" | ||
command: > | ||
sh -c "nautobot-server rqworker" | ||
depends_on: | ||
- "nautobot" | ||
env_file: | ||
- "./dev.env" | ||
volumes: | ||
- "./nautobot_config.py:/etc/nautobot/nautobot_config.py" | ||
- "../nautobot_data_validation_engine:/source/nautobot_data_validation_engine" | ||
tty: true | ||
postgres: | ||
image: "postgres:12" | ||
env_file: | ||
- "./dev.env" | ||
volumes: | ||
- "pgdata_nautobot_data_validation_engine:/var/lib/postgresql/data" | ||
redis: | ||
image: "redis:5-alpine" | ||
command: | ||
- "sh" | ||
- "-c" # this is to evaluate the $REDIS_PASSWORD from the env | ||
- "redis-server --appendonly yes --requirepass $$REDIS_PASSWORD" ## $$ because of docker-compose | ||
env_file: | ||
- "./dev.env" | ||
volumes: | ||
pgdata_nautobot_data_validation_engine: {} | ||
|
||
version: "3.4" | ||
services: | ||
nautobot: | ||
command: "nautobot-server runserver 0.0.0.0:8080 --insecure" | ||
volumes: | ||
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py" | ||
- "../:/source" | ||
ports: | ||
- "8080:8080" | ||
depends_on: | ||
- "postgres" | ||
- "redis" | ||
<<: *nautobot-build | ||
<<: *nautobot-base | ||
worker: | ||
entrypoint: "nautobot-server rqworker" | ||
volumes: | ||
- "./nautobot_config.py:/opt/nautobot/nautobot_config.py" | ||
- "../:/source" | ||
depends_on: | ||
- "nautobot" | ||
healthcheck: | ||
disable: true | ||
<<: *nautobot-base | ||
postgres: | ||
image: "postgres:13-alpine" | ||
env_file: | ||
- "dev.env" | ||
volumes: | ||
- "pgdata_nautobot_data_validation_engine:/var/lib/postgresql/data" | ||
ports: | ||
- "5432:5432" | ||
redis: | ||
image: "redis:6-alpine" | ||
command: | ||
- "sh" | ||
- "-c" # this is to evaluate the $REDIS_PASSWORD from the env | ||
- "redis-server --appendonly yes --requirepass $$REDIS_PASSWORD" | ||
env_file: | ||
- "dev.env" | ||
ports: | ||
- "6379:6379" | ||
volumes: | ||
pgdata_nautobot_data_validation_engine: # yamllint disable-line rule:empty-values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.