Skip to content

Commit

Permalink
Merge branch 'develop' into feat/#177-collect-persistent-volumes-from…
Browse files Browse the repository at this point in the history
…-cluster
  • Loading branch information
lifesbest23 committed Jul 3, 2023
2 parents a28d032 + cc786f6 commit 9c5970f
Show file tree
Hide file tree
Showing 6 changed files with 528 additions and 188 deletions.
95 changes: 84 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,36 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
pre-commit:
pre-commit-and-jest:
runs-on: "ubuntu-latest"
steps:
- name: Checkout
uses: actions/checkout@v3
- run: cd Explorer && npm install && cd .. # We use the eslint defined in the package.json
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
cache-dependency-path: Explorer/package-lock.json
- run: cd Explorer && npm ci
- run: pip install pre-commit
- run: pre-commit run --all
- name: Run pre-commit
run: pre-commit run --all
env: { SKIP: golangci-lint }
- name: Run jest-tests
if: ${{ always() }}
run: cd Explorer && npx -y jest
golangci-lint-mod:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: "1.20"
- uses: actions/checkout@v3
go-version-file: Proxy/go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52
version: v1.53
working-directory: Proxy
args: --timeout 5m

Expand Down Expand Up @@ -81,14 +90,78 @@ jobs:
#unit-test:
#runs-on: "ubuntu-latest"

setup-kubernetes-cluster:
e2e-testing:
runs-on: "ubuntu-latest"
steps:
- name: AbsaOSS/k3d-action
uses: AbsaOSS/k3d-action@v2.4.0
- uses: actions/checkout@v3
- uses: AbsaOSS/k3d-action@v2.4.0
with:
cluster-name: "Test-Cluster"
args: --agents 1

- name: Prepare kubeconfig # Copy kubeconfig into /Proxy/.kube folder
run: |
cd Proxy && mkdir .kube && cd .kube
cp -r $HOME/.kube/config .
cat config
- name: Start kit
run: docker compose up -d
- run: sleep 20 # Wait for the proxy to collect some data

- name: Cypress run e2e testing
id: cypressE2E
uses: cypress-io/github-action@v5
with:
working-directory: Explorer
browser: chrome
config: defaultCommandTimeout=10000,baseUrl=http://localhost:3000,retries=4

- name: Upload screenshots Cypress E2E Testing
uses: actions/upload-artifact@v3
if: ${{ always() && steps.cypressE2E.outcome != 'success' }}
with:
name: cypress-screenshots-E2E
path: Explorer/cypress/screenshots
if-no-files-found: ignore
retention-days: 1

- name: Upload videos Cypress E2E Testing
uses: actions/upload-artifact@v3
if: ${{ always() && steps.cypressE2E.outcome != 'success' }}
with:
name: cypress-videos-E2E
path: Explorer/cypress/videos
if-no-files-found: ignore
retention-days: 1

- name: Cypress run component testing
id: cypressComponent
if: ${{ always() }}
uses: cypress-io/github-action@v5
with:
working-directory: Explorer
install: false # we have already installed everything
component: true
browser: chrome

- name: Upload screenshots Cypress Component Testing
uses: actions/upload-artifact@v3
if: ${{ always() && steps.cypressComponent.outcome != 'success' }}
with:
name: cypress-screenshots-component-testing
path: Explorer/cypress/screenshots
if-no-files-found: ignore
retention-days: 1

- name: Upload videos Cypress Component Testing
uses: actions/upload-artifact@v3
if: ${{ always() && steps.cypressComponent.outcome != 'success' }}
with:
name: cypress-videos-component-testing
path: Explorer/cypress/videos
if-no-files-found: ignore
retention-days: 1

#proxy-integration-test:
#runs-on: "ubuntu-latest"
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ repos:
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: ^DB/testdata_init\.sql$
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
Expand Down
28 changes: 22 additions & 6 deletions DB/kubernetes-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,23 @@ CREATE TABLE pods(
"node_name" text,
"namespace" text,
"status_phase" text,
"data" json NOT NULL
"data" json NOT NULL,
"host_ip" text,
"pod_ip" text,
"pod_ips" text ARRAY,
"start_time" timestamp,
"qos_class" text
);

CREATE TABLE pod_status_conditions(
"id" int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
"pod_id" int REFERENCES pods(id) ON DELETE CASCADE,
"type" text,
"status" text,
"last_probe_time" timestamp,
"last_transition_time" timestamp,
"reason" text,
"message" text
);

CREATE TABLE "container_states"(
Expand Down Expand Up @@ -69,20 +85,20 @@ CREATE TABLE containers(
"ready" bool,
"restart_count" int,
"started" bool,
"state_id" int REFERENCES "container_states" (id),
"last_state_id" int REFERENCES "container_states" (id)
"state_id" int REFERENCES "container_states"(id),
"last_state_id" int REFERENCES "container_states"(id)
);

CREATE TABLE "volume_devices"(
"id" int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
"container_id" int REFERENCES "containers" ("id") NOT NULL,
"container_id" int REFERENCES "containers"("id") NOT NULL,
"device_path" text,
"name" text
);

CREATE TABLE "volume_mounts"(
"id" int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
"container_id" int REFERENCES "containers" ("id") NOT NULL,
"container_id" int REFERENCES "containers"("id") NOT NULL,
"mount_path" text,
"mount_propagation" text,
"name" text,
Expand All @@ -93,7 +109,7 @@ CREATE TABLE "volume_mounts"(

CREATE TABLE "container_ports"(
"id" int GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
"container_id" int REFERENCES "containers" ("id") NOT NULL,
"container_id" int REFERENCES "containers"("id") NOT NULL,
"container_port" int,
"host_ip" text,
"host_port" int,
Expand Down
Loading

0 comments on commit 9c5970f

Please sign in to comment.