Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI/CD flakiness with docker compose command style update #667

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/content-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
name: Content Validation Checking, Conversion and Validation
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
path: git-content
submodules: recursive
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

steps:
# Check-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Read Node version from .nvmrc
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
# Check-out the repository under $GITHUB_WORKSPACE
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

- name: Read node version from `.nvmrc` file
id: nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/runSchematronValidation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# Checkout repository and its submodules
steps:
# Check-out the repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v2
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332

# Check-out submodules
- name: Checkout submodules
Expand Down
1 change: 0 additions & 1 deletion src/content/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# This extends the OSCAL build container which should be located at:
# ../../vendor/oscal/build/docker-compose.yml
version: '3'
services:
cli:
volumes:
Expand Down
2 changes: 1 addition & 1 deletion src/content/module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OSCAL_DIR := vendor/oscal
CICD_DIR_PATH := $(OSCAL_DIR)/build/ci-cd
CONTENT_CONFIG_PATH := src/config

OSCAL_DOCKER := docker-compose -f $(OSCAL_DIR)/build/docker-compose.yml -f $(CONTENT_DIR)/docker-compose.yml
OSCAL_DOCKER := docker compose -f $(OSCAL_DIR)/build/docker-compose.yml -f $(CONTENT_DIR)/docker-compose.yml

init-content: ## Initialize content build environment (build Docker image)
@echo "Building Docker image for OSCAL content generation..."
Expand Down
8 changes: 4 additions & 4 deletions src/examples/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ make build-validations

## Usage

This example uses Maven. You may run directly, or via the provided `docker-compose` configuration.
This example uses Maven. You may run directly, or via the provided `docker compose` configuration.

```bash
mvn --help
```

```bash
docker-compose run example mvn --help
docker compose run example mvn --help
```

## Developer notes

To run tests:

```bash
docker-compose run example mvn test
docker compose run example mvn test
```

To auto-format code:

```bash
docker-compose run example mvn com.coveo:fmt-maven-plugin:format
docker compose run example mvn com.coveo:fmt-maven-plugin:format
```
6 changes: 3 additions & 3 deletions src/examples/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ make build-validations
To get a bash prompt within the container, run:

```bash
docker-compose run example bash -l
docker compose run example bash -l
```

You may now run and interact with the example code.
Expand All @@ -33,11 +33,11 @@ You may now run and interact with the example code.
To run tests, build the required Schematron XSLT to sef.json files and run the test script:

```bash
docker-compose run example npm run ./test.sh
docker compose run example npm run ./test.sh
```

To auto-format code:

```bash
docker-compose run example npm format
docker compose run example npm format
```
6 changes: 3 additions & 3 deletions src/examples/module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ test-examples: test-example-java test-example-python test-example-javascript ##
test-example-java: ## Test example Java project
@echo "Verifying Java example..."
cd src/examples/java && \
docker-compose run example mvn test
docker compose run example mvn test

test-example-python: ## Test example Python project
@echo "Verifying Python example..."
cd src/examples/python && \
docker-compose run example pytest
docker compose run example pytest

test-example-javascript: ## Test example Javascript project
@echo "Verifying Javascript example..."
cd src/examples/javascript && \
docker-compose run example ./test.sh
docker compose run example ./test.sh
8 changes: 4 additions & 4 deletions src/examples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ make build-validations
To get a bash prompt within the container, run:

```bash
docker-compose run example bash -l
docker compose run example bash -l
```

You may now run and interact with the example code.
Expand All @@ -29,17 +29,17 @@ You may now run and interact with the example code.
To run tests:

```bash
docker-compose run example pytest
docker compose run example pytest
```

To auto-format code:

```bash
docker-compose run example black
docker compose run example black
```

To type-check code:

```bash
docker-compose run example mypy .
docker compose run example mypy .
```
8 changes: 4 additions & 4 deletions src/validations/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ Using the command with a different version of Saxon HE. *Note that you must down
./bin/validate_with_schematron.sh -f test/demo/FedRAMP-SSP-OSCAL-Template.xml -o ~/dev/report -v 10.8
```

Alternatively, you can also use `docker-compose` to execute the validation script, like so:
Alternatively, you can also use `docker compose` to execute the validation script, like so:

```sh
docker-compose run \
docker compose run \
-w /root/src/validations \
validator \
./bin/validate_with_schematron.sh -f ./test/demo/FedRAMP-SSP-OSCAL-Template.xml
Expand Down Expand Up @@ -100,10 +100,10 @@ export TEST_DIR=$(pwd)/report/test

The JUnit XML report will be stored in the path set in the `TEST_DIR` environment variable.

Alternatively, you can also use `docker-compose` to execute the test harness, like so:
Alternatively, you can also use `docker compose` to execute the test harness, like so:

```sh
docker-compose run \
docker compose run \
-w /root/src/validations \
validator \
/root/vendor/xspec/bin/xspec.sh -s -j ./test/test_all.xspec
Expand Down
Loading