Skip to content

Commit

Permalink
Merge branch 'main' into dev/add-pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
ARADDCC002 committed Jan 10, 2025
2 parents 08e3ff1 + d8f045c commit 33b95fe
Show file tree
Hide file tree
Showing 164 changed files with 18,661 additions and 9,439 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1-bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ about: Create a report to help us improve Bailo
<!--
Thank you for reporting a possible bug in Bailo. Below is a template of useful information you can provide to help us out.
Sometimes the issue is obvious, feel free to remove any categories that don't apply.
Sometimes the issue is obvious, feel free to remove any categories that do not apply.
-->

### Subject of the issue
Expand Down
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/2-feature-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ about: Suggest an idea for this project
<!--
Thank you for suggesting an idea to make Bailo better.
Please fill in as much of the template below as you're able.
Please fill in as much of the template below as you are able.
-->

## Is your feature request related to a problem? Please describe.

Please describe the problem you are trying to solve

## Describe the solution you'd like
## Describe the solution you would like

Please describe the desired behaviour

## Describe alternatives you've considered
## Describe alternatives you have considered

Please describe alternative solutions or features you have considered
58 changes: 50 additions & 8 deletions .github/workflows/build.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,34 @@ jobs:
name: bailo_frontend
path: /tmp/bailo_frontend.tar

build_modelscan:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
# Clone repository
- uses: actions/checkout@v3

# Setup BuildX
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build modelscan image
uses: docker/build-push-action@v3
with:
context: lib/modelscan_api
file: lib/modelscan_api/Dockerfile
tags: bailo_modelscan:latest
cache-from: type=gha,scope=modelscan
cache-to: type=gha,mode=max,scope=modelscan
outputs: type=docker,dest=/tmp/bailo_modelscan.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bailo_modelscan
path: /tmp/bailo_modelscan.tar

unit_testing:
runs-on: ubuntu-latest

Expand All @@ -73,7 +101,7 @@ jobs:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.17.1
node-version: 18.18.0
cache: "npm"

# Install dependencies
Expand All @@ -96,7 +124,7 @@ jobs:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.17.1
node-version: 18.18.0
cache: "npm"

# Install dependencies
Expand All @@ -107,7 +135,7 @@ jobs:
- run: npm run lint

kubernetes:
needs: [build_backend, build_frontend]
needs: [build_backend, build_frontend, build_modelscan]
runs-on: ubuntu-latest

steps:
Expand All @@ -116,7 +144,7 @@ jobs:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.17.1
node-version: 18.18.0
cache: "npm"

# Setup BuildX
Expand All @@ -134,6 +162,11 @@ jobs:
with:
name: bailo_frontend
path: /tmp
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: bailo_modelscan
path: /tmp

- name: Start minikube
uses: medyagh/setup-minikube@master
Expand All @@ -146,6 +179,7 @@ jobs:
eval $(minikube -p minikube docker-env)
docker load -i /tmp/bailo_backend.tar
docker load -i /tmp/bailo_frontend.tar
docker load -i /tmp/bailo_modelscan.tar
# Install dependencies
- run: npm ci
Expand Down Expand Up @@ -193,6 +227,8 @@ jobs:
frontendTag: latest
backendRepository: "bailo_backend"
backendTag: latest
modelscanRepository: "bailo_modelscan"
modelscanTag: latest
# Used for k8s not openshift
ingress:
enabled: false
Expand Down Expand Up @@ -259,7 +295,7 @@ jobs:
run: kubectl logs -l app.kubernetes.io/instance=bailo --tail=-1

end_to_end:
needs: [build_backend, build_frontend]
needs: [build_backend, build_frontend, build_modelscan]
runs-on: ubuntu-latest

steps:
Expand All @@ -269,7 +305,7 @@ jobs:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.17.1
node-version: 18.18.0
cache: "npm"

# Setup BuildX
Expand All @@ -287,14 +323,20 @@ jobs:
with:
name: bailo_frontend
path: /tmp
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: bailo_modelscan
path: /tmp

- name: Load image
run: |
docker load --input /tmp/bailo_frontend.tar
docker load --input /tmp/bailo_backend.tar
docker load --input /tmp/bailo_modelscan.tar
docker image ls -a
rm -rf /tmp/bailo_frontend.tar /tmp/bailo_backend.tar
rm -rf /tmp/bailo_frontend.tar /tmp/bailo_backend.tar /tmp/bailo_modelscan.tar
# Create logs directory
- run: mkdir logs
Expand Down Expand Up @@ -389,7 +431,7 @@ jobs:
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18.17.1
node-version: 18.18.0
cache: "npm"

# Setup BuildX
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/modelscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@ jobs:
run: |
cd lib/modelscan_api
python -m pytest
# Pytest -m integration
- name: Run integration testing
run: |
cd lib/modelscan_api
python -m pytest -m integration
4 changes: 2 additions & 2 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
env:
BASE_PATH: "/Bailo"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: ./lib/landing/out

Expand All @@ -128,4 +128,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4
92 changes: 76 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
stages:
- git_sync
- os_build
- aws_build

variables:
AWS_TAG: latest
OS_TAG: $CI_COMMIT_BRANCH-$CI_COMMIT_SHORT_SHA

os-backend-build:
stage: os_build
opensrc-bailols:
stage: git_sync
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
- if: '$CI_COMMIT_BRANCH == "main" && $BFG == "true"'
when: always
allow_failure: true
- when: manual
allow_failure: true
image:
name: openjdk:latest
script:
- microdnf install -y git wget
- git clone --mirror "https://$OPENSRC_TOKEN_NAME:$OPENSRC_TOKEN@$OPENSRC_URL"
- wget https://repo1.maven.org/maven2/com/madgag/bfg/1.14.0/bfg-1.14.0.jar
- java -jar bfg-1.14.0.jar --strip-blobs-bigger-than 40M $OPENSRC_GIT_NAME
- cd $OPENSRC_GIT_NAME
- git reflog expire --expire=now --all && git gc --prune=now --aggressive
- git remote add $REPO_NAME "https://$LS_TOKEN_NAME:$LS_TOKEN@$LS_URL"
- git push -u $REPO_NAME main --force

os-backend-build:
stage: os_build
rules:
- when: manual
allow_failure: true
image:
name: docker:latest
variables:
Expand All @@ -35,9 +53,6 @@ os-backend-build:
os-frontend-build:
stage: os_build
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: always
allow_failure: true
- when: manual
allow_failure: true
image:
Expand All @@ -58,13 +73,33 @@ os-frontend-build:
- docker tag frontend-ci:$OS_TAG $REGISTRY_URL/$OPENSHIFT_PROJECTNAME/frontend-ci:$OS_TAG
- docker push $REGISTRY_URL/$OPENSHIFT_PROJECTNAME/frontend-ci:$OS_TAG

openshift-deploy:
os-modelscan-build:
stage: os_build
needs: ['os-frontend-build', 'os-backend-build']
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: always
- when: manual
allow_failure: true
image:
name: docker:latest
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ''
services:
- name: docker:stable-dind
command:
- '--tls=false'
- '--host=tcp://0.0.0.0:2375'
before_script:
- docker login -u $OPENSHIFT_USER -p $OPENSHIFT_TOKEN $REGISTRY_URL
- cd lib/modelscan_api
script:
- DOCKER_BUILDKIT=1 docker build -t modelscan-ci:$OS_TAG .
- docker tag modelscan-ci:$OS_TAG $REGISTRY_URL/$OPENSHIFT_PROJECTNAME/modelscan-ci:$OS_TAG
- docker push $REGISTRY_URL/$OPENSHIFT_PROJECTNAME/modelscan-ci:$OS_TAG

openshift-deploy:
stage: os_build
needs: ['os-frontend-build', 'os-backend-build', 'os-modelscan-build']
rules:
- when: manual
allow_failure: true
image:
Expand Down Expand Up @@ -99,6 +134,8 @@ openshift-deploy:
frontendTag: $OS_TAG
backendRepository: "$BACKEND_REPO"
backendTag: $OS_TAG
modelscanRepository: "$BACKEND_REPO"
modelscanTag: $OS_TAG
# Used for openshift
route:
enabled: true
Expand All @@ -123,9 +160,6 @@ openshift-deploy:
aws-backend-build:
stage: aws_build
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: always
allow_failure: true
- when: manual
allow_failure: true
image:
Expand Down Expand Up @@ -155,9 +189,6 @@ aws-backend-build:
aws-frontend-build:
stage: aws_build
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: always
allow_failure: true
- when: manual
allow_failure: true
image:
Expand All @@ -183,3 +214,32 @@ aws-frontend-build:
- docker tag $DOCKER_REGISTRY/$APP_NAME_FRONTEND:$AWS_TAG $DOCKER_REGISTRY/$APP_NAME_FRONTEND:$OS_TAG
- docker push $DOCKER_REGISTRY/$APP_NAME_FRONTEND:$AWS_TAG
- docker push $DOCKER_REGISTRY/$APP_NAME_FRONTEND:$OS_TAG

aws-modelscan-build:
stage: aws_build
rules:
- when: manual
allow_failure: true
image:
name: docker:latest
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ''
services:
- name: docker:stable-dind
command:
- '--tls=false'
- '--host=tcp://0.0.0.0:2375'
before_script:
- apk add --no-cache curl jq python3 py3-pip
- pip install awscli --break-system-packages
- aws ecr get-login-password | docker login --username AWS --password-stdin $DOCKER_REGISTRY
- aws --version
- docker info
- docker --version
- cd lib/modelscan_api
script:
- DOCKER_BUILDKIT=1 docker build -t $DOCKER_REGISTRY/$APP_NAME_MODELSCAN:$AWS_TAG .
- docker tag $DOCKER_REGISTRY/$APP_NAME_MODELSCAN:$AWS_TAG $DOCKER_REGISTRY/$APP_NAME_MODELSCAN:$OS_TAG
- docker push $DOCKER_REGISTRY/$APP_NAME_MODELSCAN:$AWS_TAG
- docker push $DOCKER_REGISTRY/$APP_NAME_MODELSCAN:$OS_TAG
Loading

0 comments on commit 33b95fe

Please sign in to comment.