Document not found (404)
+This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..13e02b95 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.github +.serverless +baovizta-api-sdk/target +docs +node_modules +target \ No newline at end of file diff --git a/.env b/.env new file mode 100644 index 00000000..3818eb96 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ + # Custom api URL (without the trailing slash like https://api.boavizta.org) + BOAVIZTA_API_URL="https://api.boavizta.org" \ No newline at end of file diff --git a/.env.dev b/.env.dev new file mode 100644 index 00000000..fabb2f15 --- /dev/null +++ b/.env.dev @@ -0,0 +1,2 @@ + # Custom api URL (without the trailing slash like https://api.boavizta.org) + BOAVIZTA_API_URL="https://dev.api.boavizta.org" diff --git a/.env.staging b/.env.staging new file mode 100644 index 00000000..3818eb96 --- /dev/null +++ b/.env.staging @@ -0,0 +1,2 @@ + # Custom api URL (without the trailing slash like https://api.boavizta.org) + BOAVIZTA_API_URL="https://api.boavizta.org" \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..3e72b1a5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +## Bug description + + + +## To Reproduce + + + +## Expected behavior + + + +## JSON OUTPUT + + + + +## Additional context + + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..73a211f9 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,26 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: +assignees: '' + +--- + +## Problem + + + +## Solution + + + +## Alternatives + + + +## Additional context or elements + + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..63632970 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,20 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "cargo" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + # Raise pull requests for version updates against dev branch + target-branch: "dev" + - package-ecosystem: "npm" + # Look for `package.json` and `lock` files in the `root` directory + directory: "/" + # Check the npm registry for updates every day (weekdays) + schedule: + interval: "daily" + target-branch: "dev" diff --git a/.github/workflows/docker-build-and-publish.yml b/.github/workflows/docker-build-and-publish.yml new file mode 100644 index 00000000..b2aea3b2 --- /dev/null +++ b/.github/workflows/docker-build-and-publish.yml @@ -0,0 +1,63 @@ +name: Build and Publish docker image + +on: + push: + branches: + - 'main' + - 'dev' + tags: + - 'v*' + pull_request: + branches: + - 'main' + - 'dev' + +env: + REGISTRY: ghcr.io + +jobs: + build-and-push-docker-image: + name: Build Docker image and push to github docker repository + runs-on: ubuntu-latest + + steps: + - + name: Checkout code + uses: actions/checkout@v3 + - + name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: | + ${{ env.REGISTRY }}/boavizta/cloud-scanner-cli + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - + name: Log in to the Container registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + + # - name: Build Docker image + # run: docker build . --file Dockerfile --tag ${{ env.REGISTRY }}/boavizta/cloud-scanner-cli:latest + + # - name : Tag Docker image + # run: docker tag ${{ env.REGISTRY }}/boavizta/cloud-scanner-cli:latest ${{ env.REGISTRY }}/boavizta/cloud-scanner-cli:$(date +%s) + + # - name: Push image + # run: docker push -a ${{ env.REGISTRY }}/boavizta/cloud-scanner-cli diff --git a/.github/workflows/publish-doc.yml b/.github/workflows/publish-doc.yml new file mode 100644 index 00000000..55d9aee2 --- /dev/null +++ b/.github/workflows/publish-doc.yml @@ -0,0 +1,52 @@ +name: Publish doc to Github pages +on: + push: + branches: + - main +jobs: + publish-doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: jontze/action-mdbook@v2 + with: + token: ${{secrets.GITHUB_TOKEN}} + # Optional Plugins have to be enabled + use-linkcheck: true + use-mermaid: true + use-toc: true + use-opengh: true + use-admonish: true + use-katex: true + - name: Show mdbook version + run: mdbook --version + - name: Show linkchecker version + run: mdbook-linkcheck --version + - name: Show mermaid version + run: mdbook-mermaid --version + - name: Show toc version + run: mdbook-toc --version + - name: Show open-on-gh version + run: mdbook-open-on-gh --version + - name: Show admonish version + run: mdbook-admonish --version + - name: Show katex version + run: mdbook-katex --version + - name: Deploy GitHub Pages + run: | + # This assumes your book is in the root of your repository. + # Just add a `cd` here if you need to change to another directory. + cd docs + mdbook build + mdbook test + git worktree add gh-pages + git config user.name "Deploy from CI" + git config user.email "" + cd gh-pages + # Delete the ref to avoid keeping history. + git update-ref -d refs/heads/gh-pages + rm -rf * + mv ../book/* . + git add . + git commit -m "Deploy $GITHUB_SHA to gh-pages" + git push --force --set-upstream origin gh-pages \ No newline at end of file diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml new file mode 100644 index 00000000..fcc1bec2 --- /dev/null +++ b/.github/workflows/rust-test.yml @@ -0,0 +1,23 @@ +name: test suite +on: [push, pull_request] + +jobs: + clippy: + name: cargo clippy and test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + - run: cargo clippy + - run: cargo test --all-features + + + # test: + # name: cargo test + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v3 + # - uses: dtolnay/rust-toolchain@stable + # - run: cargo test --all-features diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..225ab7a2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +cloud-scanner-cli/target/ +target/ +node_modules +.serverless +.env +.vscode diff --git a/404.html b/404.html new file mode 100644 index 00000000..56389116 --- /dev/null +++ b/404.html @@ -0,0 +1,221 @@ + + +
+ + +This URL is invalid, sorry. Please use the navigation bar or search to continue.
+ +Workload of instances are estimated using AWS cloudwatch CPU metrics summary.
+Cloud scanner uses a sampling period of 15 minutes, but impacts metrics are returned as impacts equivalent to one hour of use.
+This means that instance impacts metrics data returned can be understood as: impact for one hour of use (considering the CPU workload of 15 last minutes)
.
Why this default sampling period of 15 minutes ?
+detailed monitoring
(extra feature) for 1 minute granularity: List the available CloudWatch metrics for your instances - Amazon Elastic Compute Cloud).Impact data is retrieved from BOAVIZTA reference data API.
+This is similar to what you can get from Datavizta, but with automated inventory.
+Install Rust and linux-musl dependencies.
+# Install rust (see https://www.rust-lang.org/tools/install), validate when prompted
+curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
+source "$HOME/.cargo/env"
+# Add Linux musl target (needed for cross compilation for aws lambda)
+rustup target add x86_64-unknown-linux-musl
+
+sudo apt update && sudo apt install -y musl-tools musl-dev
+
+# Test a build
+cargo build
+
+# build a release
+cargo build --release
+
+Tested method to build Rust on Windows is to use Windows Subsystem For Linux (WSL2)
+