diff --git a/.github/ISSUE_TEMPLATE/bug-reporting.md b/.github/ISSUE_TEMPLATE/bug-reporting.md new file mode 100644 index 0000000..1d96d46 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-reporting.md @@ -0,0 +1,39 @@ +--- +name: Bug reporting +about: Describe any bug you may find. +title: "[BUG]" +labels: bug +assignees: '' + +--- + +## Environment + +- **ODTP/ODTP Component version:** Which version are you using? +- **Operating System:** Include operating system where you are running the tool. +- **Browser:** (if applicable) + +## Bug description + +### Summary: +A concise summary of the bug. + +### Steps to reproduce the bug: +1. +2. + +### Expected behavior + +What you expect to happen + +### Actual behavior +What actually happened + +### Severity and impact +- Severity: (Critical, Major, Minor, or Trivial) +- Impact: Description of the impact on users and processes. + +### Supporting information +- Screenshots/Video: Attach any relevant visuals +- Logs: Include any relevant logs or error messages +- Additional Context: Any other information that might be relevant diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..2ff1ec2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,43 @@ +--- +name: Feature request +about: Request a new feature +title: "[FEATURE]" +labels: enhancement +assignees: '' + +--- + +- **Feature name:** A concise, descriptive title for the feature. + +## Description: + +A detailed explanation of the feature. This should include what the feature is, why it is needed, and how it is expected to improve the product or process. + +## Importance Level +(Low, Medium, or High) + +An indication of the feature's importance from the strategic point of view. Please, do not take it as a priority level which will be determined as relative to the other features. + +## Origin +An explanation of how the feature aligns with projects goals, objectives, or steps of one user journey (and related user persona). This part will contain references to the preliminary assessment of feedback and should be framed in one of the user journeys defined. + +## User Impact +An assessment of how the feature will affect the end user, including any potential benefits or drawbacks. + +## Mockups or Diagrams +Visual representations (if applicable) to help clarify the feature or feedback. This could include UI mockups, flowcharts, or architectural diagrams. + +## Affected Components (examples: components, modules, … ) +Identification of specific parts of the project that the feature or feedback pertains to. This could be ODTP modules or ODTP components. + +## Technical Requirements (if possible, otherwise completed by SDSC) +Detailed technical specifications or requirements needed to implement the feature. This could include algorithms, data structures, APIs, or third-party services. + +## Related Documents/Links: +References to any related documentation, user stories, tickets, or external resources that provide additional context. + +## Dependencies (if possible, otherwise completed by SDSC): +Identification of any other features, systems, or processes that the proposed feature depends on or interacts with. This can be considered a “ready if” field and it will define what’s needed to have in order to start the development. + +## Acceptance criteria: +Specific criteria or metrics for evaluating the success or effectiveness of the feature once implemented. diff --git a/.github/workflows/multiplatform_docker_build.yml b/.github/workflows/multiplatform_docker_build.yml new file mode 100644 index 0000000..3e4736b --- /dev/null +++ b/.github/workflows/multiplatform_docker_build.yml @@ -0,0 +1,57 @@ +name: Multi-Platform Docker Build + +on: + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the repository and submodules + - name: Check out code + uses: actions/checkout@v3 + with: + submodules: true # Fetch submodules + fetch-depth: 0 # Ensure the full history is fetched + + # Step 2: Set up Docker Buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + # Step 3: Install yq + - name: Install yq + run: | + sudo apt-get update && sudo apt-get install -y wget + sudo wget https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 -O /usr/bin/yq + sudo chmod +x /usr/bin/yq + + # Step 4: Extract component-version and component-name from odtp.yml + - name: Extract component-version and component-name + id: extract_info + run: | + VERSION=$(yq e '.component-version' odtp.yml) + NAME=$(yq e '.component-name' odtp.yml) + echo "VERSION=${VERSION}" + echo "NAME=${NAME}" + echo "COMPONENT_VERSION=${VERSION}" >> $GITHUB_ENV + echo "COMPONENT_NAME=${NAME}" >> $GITHUB_ENV + + # Step 5: Log in to GitHub Container Registry + - name: Log in to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Step 6: Build and push Docker image for multiple platforms + - name: Build and push Docker image + run: | + IMAGE_NAME=ghcr.io/${{ github.repository }}/${{ env.COMPONENT_NAME }} + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --build-arg COMPONENT_VERSION=${{ env.COMPONENT_VERSION }} \ + -t $IMAGE_NAME:${{ env.COMPONENT_VERSION }} \ + -t $IMAGE_NAME:latest \ + --push . diff --git a/.github/workflows/multiplatform_docker_build_dockerhub.yml b/.github/workflows/multiplatform_docker_build_dockerhub.yml new file mode 100644 index 0000000..2bad773 --- /dev/null +++ b/.github/workflows/multiplatform_docker_build_dockerhub.yml @@ -0,0 +1,56 @@ +name: Multi-Platform Docker Build for Dockerhub + +on: + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: ubuntu-latest + + steps: + # Step 1: Check out the repository and submodules + - name: Check out code + uses: actions/checkout@v3 + with: + submodules: true # Fetch submodules + fetch-depth: 0 # Ensure the full history is fetched + + # Step 2: Set up Docker Buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + # Step 3: Install yq + - name: Install yq + run: | + sudo apt-get update && sudo apt-get install -y wget + sudo wget https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 -O /usr/bin/yq + sudo chmod +x /usr/bin/yq + + # Step 4: Extract component-version and component-name from odtp.yml + - name: Extract component-version and component-name + id: extract_info + run: | + VERSION=$(yq e '.component-version' odtp.yml) + NAME=$(yq e '.component-name' odtp.yml) + echo "VERSION=${VERSION}" + echo "NAME=${NAME}" + echo "COMPONENT_VERSION=${VERSION}" >> $GITHUB_ENV + echo "COMPONENT_NAME=${NAME}" >> $GITHUB_ENV + + # Step 5: Log in to Docker Hub + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + # Step 6: Build and push Docker image for multiple platforms + - name: Build and push Docker image + run: | + IMAGE_NAME=${{ secrets.DOCKER_USERNAME }}/${{ env.COMPONENT_NAME }} + docker buildx build \ + --platform linux/amd64,linux/arm64 \ + --build-arg COMPONENT_VERSION=${{ env.COMPONENT_VERSION }} \ + -t $IMAGE_NAME:${{ env.COMPONENT_VERSION }} \ + -t $IMAGE_NAME:latest \ + --push . diff --git a/Dockerfile b/Dockerfile index 3f661cf..81ab974 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,23 @@ FROM ubuntu:22.04 -RUN apt update -RUN apt install python3.10 python3-pip -y - ################################################## # Ubuntu setup ################################################## -RUN apt-get update \ - && apt-get install -y wget \ - && rm -rf /var/lib/apt/lists/* - -RUN apt-get update && apt-get -y upgrade \ - && apt-get install -y --no-install-recommends \ +# Ubuntu setup +RUN apt update && apt install -y \ + python3.10 \ + python3-pip \ + wget \ unzip \ nano \ - git \ + git \ g++ \ gcc \ htop \ zip \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* + ca-certificates && \ + rm -rf /var/lib/apt/lists/* ################################################## # ODTP setup @@ -66,4 +62,7 @@ COPY ./odtp-component-client /odtp/odtp-component-client COPY ./app /odtp/odtp-app WORKDIR /odtp +# Fix for end of the line issue on Windows. Avoid error when building on windows +RUN find /odtp -type f -iname "*.sh" -exec sed -i 's/\r$//' {} \; + ENTRYPOINT ["bash", "/odtp/odtp-component-client/startup.sh"] \ No newline at end of file diff --git a/README.md b/README.md index 9f5b7d3..145be52 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This is a dashboard to visualize output from matsim. ```odtp new component odtp new odtp-component-entry \ --name odtp-travel-data-dashboard \ ---component-version 0.1.1 \ +--component-version 0.1.6 \ --repository https://github.com/odtp-org/odtp-travel-data-dashboard ``` @@ -46,6 +46,15 @@ docker run -it --rm -p 8502:8501 odtp-travel-data-dashboard ## Changelog +- v0.1.6 + - Not github credential required as the github tool repo is now public + - Github actions + - Refined Dockerfile + +- v0.1.5 + +- v0.1.4 + - v0.1.3 - Add parameters: DATA_INPUT_OPTION and DATA_INPUT_PATH diff --git a/app/app.sh b/app/app.sh index 2838ace..d9e1a4a 100644 --- a/app/app.sh +++ b/app/app.sh @@ -11,7 +11,7 @@ # Actions # A1 - Clone github -git clone https://$GITHUB_USERNAME:$GITHUB_TOKEN@github.com/zuocsfm/OD_data_dashboard.git /odtp/odtp-workdir/OD_data_dashboard +git clone https://github.com/zuocsfm/OD_data_dashboard.git /odtp/odtp-workdir/OD_data_dashboard cd /odtp/odtp-workdir/OD_data_dashboard git checkout 86bf7bdc631961ac05c976fc280e78d93d666d02 diff --git a/odtp.yml b/odtp.yml index d71244c..316de3b 100644 --- a/odtp.yml +++ b/odtp.yml @@ -1,7 +1,7 @@ # This file should contain basic component information for your component. component-name: odtp-travel-data-dashboard component-author: Carlos Vivar Rios -component-version: 0.1.0 +component-version: 0.1.6 component-repository: https://github.com/odtp-org/odtp-travel-data-dashboard component-license: AGPL-3.0 component-type: ephemeral