Skip to content

Commit

Permalink
Merge pull request #99 from NASA-AMMOS/update--aerie-2.1.0
Browse files Browse the repository at this point in the history
Aerie 2.1.0
  • Loading branch information
cartermak authored Dec 7, 2023
2 parents e073c42 + ba2ed54 commit 3f2edc6
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOCKER_TAG=v1.14.0
DOCKER_TAG=v2.1.0
REPOSITORY_DOCKER_URL=ghcr.io/nasa-ammos

AERIE_USERNAME=aerie
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
strategy:
matrix:
python-version: [ "3.6.15", "3.11" ]
aerie-version: ["1.13.0", "1.14.0"]
aerie-version: ["2.1.0"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
70 changes: 24 additions & 46 deletions docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ services:
GQL_API_URL: http://localhost:8080/v1/graphql
HASURA_GRAPHQL_JWT_SECRET: "${HASURA_GRAPHQL_JWT_SECRET}"
LOG_FILE: console
LOG_LEVEL: debug
NODE_TLS_REJECT_UNAUTHORIZED: "0"
LOG_LEVEL: warn
PORT: 9000
POSTGRES_AERIE_MERLIN_DB: aerie_merlin
POSTGRES_HOST: postgres
Expand All @@ -21,6 +20,8 @@ services:
restart: always
volumes:
- aerie_file_store:/app/files
networks:
- aerie_net
aerie_merlin:
container_name: aerie_merlin
depends_on: ["postgres"]
Expand All @@ -43,8 +44,10 @@ services:
restart: always
volumes:
- aerie_file_store:/usr/src/app/merlin_file_store
networks:
- aerie_net
aerie_merlin_worker_1:
container_name: aerie_merlin_worker_1
container_name: aerie_merlin_worker
depends_on: ["postgres"]
environment:
MERLIN_WORKER_DB: "aerie_merlin"
Expand All @@ -64,27 +67,8 @@ services:
restart: always
volumes:
- aerie_file_store:/usr/src/app/merlin_file_store:ro
aerie_merlin_worker_2:
container_name: aerie_merlin_worker_2
depends_on: ["postgres"]
environment:
MERLIN_WORKER_DB: "aerie_merlin"
MERLIN_WORKER_DB_PASSWORD: "${AERIE_PASSWORD}"
MERLIN_WORKER_DB_PORT: 5432
MERLIN_WORKER_DB_SERVER: postgres
MERLIN_WORKER_DB_USER: "${AERIE_USERNAME}"
MERLIN_WORKER_LOCAL_STORE: /usr/src/app/merlin_file_store
SIMULATION_PROGRESS_POLL_PERIOD_MILLIS: 2000
JAVA_OPTS: >
-Dorg.slf4j.simpleLogger.defaultLogLevel=INFO
-Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=WARN
-Dorg.slf4j.simpleLogger.logFile=System.err
UNTRUE_PLAN_START: "2000-01-01T11:58:55.816Z"
image: "${REPOSITORY_DOCKER_URL}/aerie-merlin-worker:${DOCKER_TAG}"
ports: ["27188:8080"]
restart: always
volumes:
- aerie_file_store:/usr/src/app/merlin_file_store:ro
networks:
- aerie_net
aerie_scheduler:
container_name: aerie_scheduler
depends_on: ["aerie_merlin", "postgres"]
Expand All @@ -105,6 +89,8 @@ services:
restart: always
volumes:
- aerie_file_store:/usr/src/app/merlin_file_store
networks:
- aerie_net
aerie_scheduler_worker_1:
container_name: aerie_scheduler_worker_1
depends_on: ["postgres"]
Expand All @@ -127,27 +113,8 @@ services:
restart: always
volumes:
- aerie_file_store:/usr/src/app/merlin_file_store:ro
aerie_scheduler_worker_2:
depends_on: ["postgres"]
environment:
HASURA_GRAPHQL_ADMIN_SECRET: "${HASURA_GRAPHQL_ADMIN_SECRET}"
MERLIN_GRAPHQL_URL: http://hasura:8080/v1/graphql
SCHEDULER_WORKER_DB: "aerie_scheduler"
SCHEDULER_WORKER_DB_PASSWORD: "${AERIE_PASSWORD}"
SCHEDULER_WORKER_DB_PORT: 5432
SCHEDULER_WORKER_DB_SERVER: postgres
SCHEDULER_WORKER_DB_USER: "${AERIE_USERNAME}"
SCHEDULER_OUTPUT_MODE: UpdateInputPlanWithNewActivities
MERLIN_LOCAL_STORE: /usr/src/app/merlin_file_store
SCHEDULER_RULES_JAR: /usr/src/app/merlin_file_store/scheduler_rules.jar
JAVA_OPTS: >
-Dorg.slf4j.simpleLogger.log.com.zaxxer.hikari=INFO
-Dorg.slf4j.simpleLogger.logFile=System.err
image: "${REPOSITORY_DOCKER_URL}/aerie-scheduler-worker:${DOCKER_TAG}"
ports: ["27190:8080"]
restart: always
volumes:
- aerie_file_store:/usr/src/app/merlin_file_store:ro
networks:
- aerie_net
aerie_sequencing:
container_name: aerie_sequencing
depends_on: ["postgres"]
Expand All @@ -168,12 +135,13 @@ services:
restart: always
volumes:
- aerie_file_store:/usr/src/app/sequencing_file_store
networks:
- aerie_net
aerie_ui:
container_name: aerie_ui
depends_on: ["postgres"]
environment:
ORIGIN: http://localhost
NODE_TLS_REJECT_UNAUTHORIZED: "0"
PUBLIC_LOGIN_PAGE: "enabled"
PUBLIC_GATEWAY_CLIENT_URL: http://localhost:9000
PUBLIC_GATEWAY_SERVER_URL: http://aerie_gateway:9000
Expand All @@ -183,6 +151,8 @@ services:
image: "${REPOSITORY_DOCKER_URL}/aerie-ui:${DOCKER_TAG}"
ports: ["80:80"]
restart: always
networks:
- aerie_net
hasura:
container_name: aerie_hasura
depends_on: ["postgres"]
Expand All @@ -205,9 +175,12 @@ services:
image: "${REPOSITORY_DOCKER_URL}/aerie-hasura:${DOCKER_TAG}"
ports: ["8080:8080"]
restart: always
networks:
- aerie_net
postgres:
container_name: aerie_postgres
environment:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_USER: "${POSTGRES_USER}"
AERIE_USERNAME: "${AERIE_USERNAME}"
Expand All @@ -217,8 +190,13 @@ services:
restart: always
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- aerie_net

volumes:
aerie_file_store:
mission_file_store:
postgres_data:

networks:
aerie_net:
35 changes: 23 additions & 12 deletions src/aerie_cli/aerie_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1631,21 +1631,32 @@ def get_constraint_by_id(self, id):
def get_constraint_violations(self, plan_id):
get_violations_query = """
query ($plan_id: Int!) {
constraintResults: constraintViolations(planId: $plan_id) {
constraintId
constraintName
type
resourceIds
violations {
activityInstanceIds
windows {
start
constraintResponses: constraintViolations(planId: $plan_id) {
success
results {
constraintId
constraintName
resourceIds
type
gaps {
end
start
}
violations {
activityInstanceIds
windows {
end
start
}
}
}
gaps {
start
end
errors {
message
stack
location {
column
line
}
}
}
}
Expand Down
23 changes: 19 additions & 4 deletions tests/integration_tests/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Test against an active instance of Aerie
# Integration Tests

Aerie-CLI integration tests exercise commands against an actual instance of Aerie.

## WARNING

These tests will delete and modify data permanently. Expect the localhost instance of Aerie to be modified heavily. These test will delete all models.

See: [localhost configuration](files/configuration/localhost_config.json)

## Running locally
## Running Locally

To set up a local test environment, use the test environment and docker-compose files in the root of the repo:

Expand All @@ -15,7 +18,19 @@ docker compose -f docker-compose-test.yml up

Invoke the tests using `pytest` from the `tests/integration_tests` directory.

## Tests
## Updating Tests for New Aerie Versions

Integration tests are automatically run by CI against all supported Aerie versions. To add and test support for a new Aerie version:

1. Download the appropriate version release JAR for the [Banananation model](https://github.com/NASA-AMMOS/aerie/packages/1171106/versions) and add it to `tests/integration_tests/models`, named as `banananation-X.X.X.jar` (substituting the correct version number).
2. Update the [`.env`](../../.env) file `DOCKER_TAG` value to the new version string. This defaults the local deployment to the latest Aerie version.
3. Update [`docker-compose-test.yml`](../../docker-compose-test.yml) as necessary to match the new Aerie version. The [aerie-ui compose file](https://github.com/NASA-AMMOS/aerie-ui/blob/develop/docker-compose-test.yml) can be a helpful reference to identify changes.
4. Manually run the integration tests and update the code and tests as necessary for any Aerie changes.
5. Update the `aerie-version` list in the [CI configuration](../../.github/workflows/test.yml) to include the new version.
6. If breaking changes are necessary to support the new Aerie version, remove any Aerie versions which are no longer supported from the CI configuration and remove the corresponding banananation JAR file.
7. Open a PR and verify all tests still pass.

## Summary of Integration Tests

### [Configurations test](test_configurations.py)
- Configuration initialization is in conftest.py to ensure all tests use localhost
Expand All @@ -39,4 +54,4 @@ Invoke the tests using `pytest` from the `tests/integration_tests` directory.
- Test all `metadata` commands

### [Constraints test](test_constraints.py)
- Test all `constraints` commands
- Test all `constraints` commands
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/integration_tests/test_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def test_last_activate():

result = runner.invoke(
app,
["activate"],
["activate", "-r", "aerie_admin"],
input=str(configuration_id) + "\n",
catch_exceptions=False,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/test_scheduling.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def set_up_environment(request):

def cli_schedule_upload():
schedule_file_path = os.path.join(GOALS_PATH, "schedule1.txt")
with open(schedule_file_path, "x") as fid:
with open(schedule_file_path, "w") as fid:
fid.write(GOAL_PATH)
result = runner.invoke(
app,
Expand Down

0 comments on commit 3f2edc6

Please sign in to comment.