Skip to content

Commit

Permalink
making reviewed changes
Browse files Browse the repository at this point in the history
Signed-off-by: ntishchauhan0022 <nitishchauhan0022@gmail.com>
  • Loading branch information
nitishchauhan0022 committed Jul 18, 2023
1 parent 7edb7e9 commit ab8f360
Show file tree
Hide file tree
Showing 13 changed files with 161 additions and 48 deletions.
22 changes: 9 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,33 +160,29 @@ jobs:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
mv kubectl /home/circleci/bin/
make download # no-op if we restored from cache
mage download # no-op if we restored from cache
- run:
name: Build
command: |
make build-ci
make build-docker-full-bundle
mage buildCI
mage buildDockers full-bundle
- run:
name: e2e test environment setup
command: make tests-e2e-setup
command: mage teste2eSetup

- run:
name: Enable integration tests
command: echo 'export INTEGRATION_ENABLED="true"' >> $BASH_ENV

- run:
name: e2e tests
command: make tests-e2e-no-setup

- run:
name: e2e test environment teardown
command: make tests-e2e-teardown
command: mage testse2eNoSetup

- run:
name: Prepare reports
command: make junit-report
command: mage junitReport
when: always

- store_test_results:
Expand Down Expand Up @@ -288,7 +284,7 @@ jobs:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
make download # no-op if we restored from cache
mage download # no-op if we restored from cache
- run:
name: Build armadactl release artifacts
Expand Down Expand Up @@ -429,7 +425,7 @@ jobs:
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
make download # no-op if we restored from cache
mage download # no-op if we restored from cache
- run:
name: Push dotnet clients to nuget
Expand All @@ -440,7 +436,7 @@ jobs:
go mod download
go run github.com/magefile/mage@v1.14.0 -v BootstrapTools
go run github.com/magefile/mage@v1.14.0 -v proto
RELEASE_TAG=${CIRCLE_TAG#"v"} make push-nuget
RELEASE_TAG=${CIRCLE_TAG#"v"} mage pushNuget
- store_artifacts:
path: bin/client/DotNet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/airflow-operator-release-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
version: '3.17.3'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: make airflow-operator
- run: mage airflowOperator
- uses: ./.github/workflows/python-tests
with:
python-version: '3.8'
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/airflow-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ on:
- 'docs/python_airflow_operator.md'
- 'docs/python_armada_client.md'
- 'internal/jobservice/*'
- 'makefile'
- 'pkg/api/*.proto'
- 'pkg/api/jobservice/*.proto'
- 'scripts/build-airflow-operator.sh'
Expand All @@ -34,7 +33,6 @@ on:
- 'docs/python_airflow_operator.md'
- 'docs/python_armada_client.md'
- 'internal/jobservice/*'
- 'makefile'
- 'pkg/api/*.proto'
- 'pkg/api/jobservice/*.proto'
- 'scripts/build-airflow-operator.sh'
Expand Down Expand Up @@ -62,7 +60,7 @@ jobs:
with:
version: '3.17.3'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: make airflow-operator
- run: mage airflowOperator
- uses: ./.github/workflows/python-tests
with:
python-version: ${{ matrix.python }}
Expand Down Expand Up @@ -106,5 +104,5 @@ jobs:
with:
version: '3.17.3'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: make tests-e2e-airflow
- run: mage teste2eAirflow

10 changes: 5 additions & 5 deletions .github/workflows/build-release-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
steps:
- uses: actions/checkout@v3.1.0
- uses: ./.github/workflows/go-setup
- run: make build-ci
- run: make tests-e2e-setup
- run: make tests-e2e-no-setup
- run: mage BuildCI
- run: mage teste2eSetup
- run: mage testse2eNoSetup
env:
INTEGRATION_ENABLED: true
- run: make junit-report
- run: mage junitReport
- name: Upload junit report
uses: actions/upload-artifact@v3.1.1
with:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Save docker images to artifact
run: |
mkdir -p docker-images
docker save armada | gzip > docker-images/armada.tar.gz
docker save armada-server | gzip > docker-images/armada-server.tar.gz
docker save armada-executor | gzip > docker-images/armada-executor.tar.gz
docker save armadactl | gzip > docker-images/armadactl.tar.gz
docker save testsuite | gzip > docker-images/testsuite.tar.gz
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
version: '3.17.3'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/workflows/go-setup
- name: Make Proto
run: make proto
- name: Mage Proto
run: mage proto

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ runs:
go-version: ${{ matrix.go }}
- name: Setup dependencies
shell: bash
run: make download
run: mage download
Empty file added .github/workflows/go.yml
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/python-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ jobs:
with:
version: '3.17.3'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- run: make tests-e2e-python
- run: mage teste2epython
2 changes: 1 addition & 1 deletion .github/workflows/python-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
version: '3.17.3'
repo-token: ${{ inputs.github-token }}
# Generate the proto files for python, required for later steps
- run: make python
- run: mage buildPython
shell: bash
- name: Run tox format environment
run: tox -e format
Expand Down
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ dockers:
goos: linux
goarch: amd64
image_templates:
- "{{ .Env.DOCKER_REPO }}armada-testsuite:latest"
- "{{ .Env.DOCKER_REPO }}armada-testsuite:{{ .Version }}"
- "{{ .Env.DOCKER_REPO }}testsuite:latest"
- "{{ .Env.DOCKER_REPO }}testsuite:{{ .Version }}"
build_flag_templates: *BUILD_FLAG_TEMPLATES
ids:
- testsuite
Expand Down
6 changes: 3 additions & 3 deletions magefiles/airflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func stopAirflow() error {
}

// AirflowOperator builds the Airflow Operator
func airflowOperator() error {
func AirflowOperator() error {
fmt.Println("Building Airflow Operator...")

err := os.RemoveAll("proto-airflow")
Expand All @@ -85,12 +85,12 @@ func airflowOperator() error {
return fmt.Errorf("failed to create proto-airflow directory: %w", err)
}

_, err = dockerOutput("buildx", "build", "-o", "type=docker", "-t", "armada-airflow-operator-builder", "-f", "./build/airflow-operator/Dockerfile", ".")
err = dockerRun("buildx", "build", "-o", "type=docker", "-t", "armada-airflow-operator-builder", "-f", "./build/airflow-operator/Dockerfile", ".")
if err != nil {
return fmt.Errorf("failed to build Airflow Operator: %w", err)
}

_, err = dockerOutput("run", "--rm", "-v", "${PWD}/proto-airflow:/proto-airflow", "-v", "${PWD}:/go/src/armada", "-w", "/go/src/armada", "armada-airflow-operator-builder", "./scripts/build-airflow-operator.sh")
err = dockerRun("run", "--rm", "-v", "${PWD}/proto-airflow:/proto-airflow", "-v", "${PWD}:/go/src/armada", "-w", "/go/src/armada", "armada-airflow-operator-builder", "./scripts/build-airflow-operator.sh")
if err != nil {
return fmt.Errorf("failed to run build-airflow-operator.sh script: %w", err)
}
Expand Down
16 changes: 13 additions & 3 deletions magefiles/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func JunitReport() error {
}

// Make sure everything has been synced to disk
if err := sh.Run("sync"); err != nil {
if err := sh.RunV("sync"); err != nil {
return fmt.Errorf("failed to sync: %w", err)
}

Expand All @@ -252,7 +252,7 @@ func JunitReport() error {
}

if len(goTestCmd) == 0 {
if err = sh.RunV("bash", "-c", "cat test_reports/*.txt | go-junit-report > test_reports/junit.xml"); err != nil {
if err := sh.RunV("bash", "-c", "cat test_reports/*.txt | go-junit-report > test_reports/junit.xml"); err != nil {
return err
}
} else {
Expand All @@ -264,7 +264,7 @@ func JunitReport() error {
return nil
}

// Code generation tasks: statik, goimports, go generate.
// Code generation tasks: statik, goimports, go generate.
func Generate() error {
go_cmd, err := go_CMD()
if err != nil {
Expand Down Expand Up @@ -310,3 +310,13 @@ func Generate() error {
}
return nil
}

// CI Image to build
func BuildCI() error {
ciImage := []string{"server", "executor", "armadactl", "testsuite", "lookout", "lookoutingester", "lookoutv2", "lookoutingesterv2", "eventingester", "scheduler", "scheduleringester", "binoculars", "jobservice"}
err := goreleaserMinimalRelease(ciImage...)
if err != nil {
return err
}
return nil
}
Loading

0 comments on commit ab8f360

Please sign in to comment.