|
| 1 | +# Kata Containers Test Dashboard |
| 2 | + |
| 3 | +This repository contains the **Kata Containers Test Dashboard**, a web application that visualizes data for the nightly tests run by the Kata Containers repository. Built using **Next.js** and styled with **TailwindCSS**, this dashboard provides a simple and efficient interface to monitor test results, leveraging modern frontend technologies to ensure responsive and scalable performance. |
| 4 | + |
| 5 | +## Features |
| 6 | +- Fetches nightly CI test data using custom scripts. |
| 7 | +- Displays weather-like icons to reflect test statuses (e.g., sunny for success, stormy for failures). |
| 8 | +- Utilizes **Next.js** for server-side rendering and optimized builds. |
| 9 | +- **TailwindCSS** for responsive, utility-first styling. |
| 10 | +- Integration of **PrimeReact** components for UI elements. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Project Structure |
| 15 | + |
| 16 | +```bash |
| 17 | +. |
| 18 | +├── next.config.js # Next.js configuration |
| 19 | +├── package.json # Project dependencies and scripts |
| 20 | +├── package-lock.json # Dependency lock file |
| 21 | +├── pages |
| 22 | +│ ├── _app.js # Application wrapper for global setup |
| 23 | +│ └── index.js # Main dashboard page |
| 24 | +├── postcss.config.js # PostCSS configuration for TailwindCSS |
| 25 | +├── public |
| 26 | +│ ├── cloudy.svg # Weather icons for test statuses |
| 27 | +│ ├── favicon.ico |
| 28 | +│ ├── partially-sunny.svg |
| 29 | +│ ├── rainy.svg |
| 30 | +│ ├── stormy.svg |
| 31 | +│ └── sunny.svg |
| 32 | +├── README.md # Project documentation (this file) |
| 33 | +├── scripts |
| 34 | +│ └── fetch-ci-nightly-data.js # Script to fetch nightly test data |
| 35 | +├── styles |
| 36 | +│ └── globals.css # Global CSS imports |
| 37 | +└── tailwind.config.js # TailwindCSS configuration |
| 38 | +``` |
| 39 | + |
| 40 | +### Key Files |
| 41 | +- **`pages/index.js`**: The main entry point of the dashboard, displaying test results and their statuses. |
| 42 | +- **`scripts/fetch-ci-nightly-data.js`**: Custom script to retrieve CI data for the dashboard. |
| 43 | +- **`styles/globals.css`**: Custom global styles, mainly extending the TailwindCSS base. |
| 44 | +- **`public/`**: Contains static assets like icons representing different test statuses. |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +## Setup Instructions |
| 49 | + |
| 50 | +Follow these steps to set up the development environment for the Kata Containers Test Dashboard: |
| 51 | + |
| 52 | +### Prerequisites |
| 53 | +- [**Node.js**](https://nodejs.org/en/download) (version 18.x or later recommended) |
| 54 | +- **npm** (comes with Node.js) |
| 55 | + |
| 56 | +### Installation |
| 57 | + |
| 58 | +1. **Clone the repository**: |
| 59 | + ```bash |
| 60 | + git clone https://github.com/kata-containers/kata-containers.github.io.git |
| 61 | + cd kata-containers.github.io |
| 62 | + ``` |
| 63 | + |
| 64 | +2. **Install dependencies**: |
| 65 | + Run the following command to install both the project dependencies and development dependencies. |
| 66 | + ```bash |
| 67 | + npm install |
| 68 | + ``` |
| 69 | + |
| 70 | +### Development |
| 71 | + |
| 72 | +3. **Run the development server**: |
| 73 | + Start the Next.js development server with hot-reloading enabled. |
| 74 | + ```bash |
| 75 | + node scripts/fetch-ci-nightly-data.js > job_stats.json |
| 76 | + npm run dev |
| 77 | + ``` |
| 78 | + |
| 79 | + The app will be available at [http://localhost:3000](http://localhost:3000). |
| 80 | + |
| 81 | +### Production |
| 82 | + |
| 83 | +4. **Build for production**: |
| 84 | + To create an optimized production build, run: |
| 85 | + ```bash |
| 86 | + npm run build |
| 87 | + ``` |
| 88 | + |
| 89 | +5. **Start the production server**: |
| 90 | + After building, you can start the server: |
| 91 | + ```bash |
| 92 | + npm start |
| 93 | + ``` |
| 94 | + |
| 95 | +### Scripts |
| 96 | + |
| 97 | +- **Fetch CI Nightly Data**: |
| 98 | + The `fetch-ci-nightly-data.js` script can be executed manually to pull the latest CI test data from the Kata Containers repository: |
| 99 | + ```bash |
| 100 | + node scripts/fetch-ci-nightly-data.js > job_stats.json |
| 101 | + ``` |
0 commit comments