Skip to content

Commit 683fcb6

Browse files
committed
feat: github actions, updated component client, fix windows building
1 parent d82c95b commit 683fcb6

10 files changed

Lines changed: 213 additions & 7 deletions

.env.dist

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ ODTP_STEP=
3434
ODTP_COMPONENT=
3535
ODTP_COMPONENT_VERSION=
3636

37-
# OTHER ENV VARIABLES
38-
TRANSFER_INPUT_TO_OUTPUT=
39-
ODTP_SAVE_SNAPSHOT=
37+
### OTHER ENV VARIABLES (FALSE/TRUE)
38+
TRANSFER_INPUT_TO_OUTPUT=FALSE
39+
ODTP_SAVE_SNAPSHOT=FALSE
40+
ODTP_SAVE_IN_RESULT=TRUE
41+
ODTP_LOGS_IN_DB=FALSE
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug reporting
3+
about: Describe any bug you may find.
4+
title: "[BUG]"
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
## Environment
11+
12+
- **ODTP/ODTP Component version:** Which version are you using?
13+
- **Operating System:** Include operating system where you are running the tool.
14+
- **Browser:** (if applicable)
15+
16+
## Bug description
17+
18+
### Summary:
19+
A concise summary of the bug.
20+
21+
### Steps to reproduce the bug:
22+
1.
23+
2.
24+
25+
### Expected behavior
26+
27+
What you expect to happen
28+
29+
### Actual behavior
30+
What actually happened
31+
32+
### Severity and impact
33+
- Severity: (Critical, Major, Minor, or Trivial)
34+
- Impact: Description of the impact on users and processes.
35+
36+
### Supporting information
37+
- Screenshots/Video: Attach any relevant visuals
38+
- Logs: Include any relevant logs or error messages
39+
- Additional Context: Any other information that might be relevant
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Feature request
3+
about: Request a new feature
4+
title: "[FEATURE]"
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
- **Feature name:** A concise, descriptive title for the feature.
11+
12+
## Description:
13+
14+
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.
15+
16+
## Importance Level
17+
(Low, Medium, or High)
18+
19+
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.
20+
21+
## Origin
22+
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.
23+
24+
## User Impact
25+
An assessment of how the feature will affect the end user, including any potential benefits or drawbacks.
26+
27+
## Mockups or Diagrams
28+
Visual representations (if applicable) to help clarify the feature or feedback. This could include UI mockups, flowcharts, or architectural diagrams.
29+
30+
## Affected Components (examples: components, modules, … )
31+
Identification of specific parts of the project that the feature or feedback pertains to. This could be ODTP modules or ODTP components.
32+
33+
## Technical Requirements (if possible, otherwise completed by SDSC)
34+
Detailed technical specifications or requirements needed to implement the feature. This could include algorithms, data structures, APIs, or third-party services.
35+
36+
## Related Documents/Links:
37+
References to any related documentation, user stories, tickets, or external resources that provide additional context.
38+
39+
## Dependencies (if possible, otherwise completed by SDSC):
40+
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.
41+
42+
## Acceptance criteria:
43+
Specific criteria or metrics for evaluating the success or effectiveness of the feature once implemented.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Multi-Platform Docker Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
# Step 1: Check out the repository and submodules
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
with:
15+
submodules: true # Fetch submodules
16+
fetch-depth: 0 # Ensure the full history is fetched
17+
18+
# Step 2: Set up Docker Buildx
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
# Step 3: Install yq
23+
- name: Install yq
24+
run: |
25+
sudo apt-get update && sudo apt-get install -y wget
26+
sudo wget https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 -O /usr/bin/yq
27+
sudo chmod +x /usr/bin/yq
28+
29+
# Step 4: Extract component-version and component-name from odtp.yml
30+
- name: Extract component-version and component-name
31+
id: extract_info
32+
run: |
33+
VERSION=$(yq e '.component-version' odtp.yml)
34+
NAME=$(yq e '.component-name' odtp.yml)
35+
echo "VERSION=${VERSION}"
36+
echo "NAME=${NAME}"
37+
echo "COMPONENT_VERSION=${VERSION}" >> $GITHUB_ENV
38+
echo "COMPONENT_NAME=${NAME}" >> $GITHUB_ENV
39+
40+
# Step 5: Log in to GitHub Container Registry
41+
- name: Log in to GitHub Container Registry
42+
uses: docker/login-action@v2
43+
with:
44+
registry: ghcr.io
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
# Step 6: Build and push Docker image for multiple platforms
49+
- name: Build and push Docker image
50+
run: |
51+
IMAGE_NAME=ghcr.io/${{ github.repository }}/${{ env.COMPONENT_NAME }}
52+
docker buildx build \
53+
--platform linux/amd64,linux/arm64 \
54+
--build-arg COMPONENT_VERSION=${{ env.COMPONENT_VERSION }} \
55+
-t $IMAGE_NAME:${{ env.COMPONENT_VERSION }} \
56+
-t $IMAGE_NAME:latest \
57+
--push .
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Multi-Platform Docker Build for Dockerhub
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build-and-publish:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
# Step 1: Check out the repository and submodules
12+
- name: Check out code
13+
uses: actions/checkout@v3
14+
with:
15+
submodules: true # Fetch submodules
16+
fetch-depth: 0 # Ensure the full history is fetched
17+
18+
# Step 2: Set up Docker Buildx
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
# Step 3: Install yq
23+
- name: Install yq
24+
run: |
25+
sudo apt-get update && sudo apt-get install -y wget
26+
sudo wget https://github.com/mikefarah/yq/releases/download/v4.35.1/yq_linux_amd64 -O /usr/bin/yq
27+
sudo chmod +x /usr/bin/yq
28+
29+
# Step 4: Extract component-version and component-name from odtp.yml
30+
- name: Extract component-version and component-name
31+
id: extract_info
32+
run: |
33+
VERSION=$(yq e '.component-version' odtp.yml)
34+
NAME=$(yq e '.component-name' odtp.yml)
35+
echo "VERSION=${VERSION}"
36+
echo "NAME=${NAME}"
37+
echo "COMPONENT_VERSION=${VERSION}" >> $GITHUB_ENV
38+
echo "COMPONENT_NAME=${NAME}" >> $GITHUB_ENV
39+
40+
# Step 5: Log in to Docker Hub
41+
- name: Log in to Docker Hub
42+
uses: docker/login-action@v2
43+
with:
44+
username: ${{ secrets.DOCKER_USERNAME }}
45+
password: ${{ secrets.DOCKER_PASSWORD }}
46+
47+
# Step 6: Build and push Docker image for multiple platforms
48+
- name: Build and push Docker image
49+
run: |
50+
IMAGE_NAME=${{ secrets.DOCKER_USERNAME }}/${{ env.COMPONENT_NAME }}
51+
docker buildx build \
52+
--platform linux/amd64,linux/arm64 \
53+
--build-arg COMPONENT_VERSION=${{ env.COMPONENT_VERSION }} \
54+
-t $IMAGE_NAME:${{ env.COMPONENT_VERSION }} \
55+
-t $IMAGE_NAME:latest \
56+
--push .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# ODTP testing
22
odtp-input/
33
odtp-output/
4+
odtp-logs/
45

56
# Mac crap
67
.DS_Store

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,7 @@ COPY ./odtp-component-client /odtp/odtp-component-client
8181
COPY ./app /odtp/odtp-app
8282
WORKDIR /odtp
8383

84+
# Fix for end of the line issue on Windows. Avoid error when building on windows
85+
RUN find /odtp -type f -iname "*.sh" -exec sed -i 's/\r$//' {} \;
86+
8487
ENTRYPOINT ["bash", "/odtp/odtp-component-client/startup.sh"]

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ODTP component for running mobility simulation
1212
```odtp new component
1313
odtp new odtp-component-entry \
1414
--name odtp-mobility-simulation \
15-
--component-version 0.0.1 \
15+
--component-version v0.1.1 \
1616
--repository https://github.com/odtp-org/odtp-mobility-simulation.git
1717
```
1818

@@ -89,8 +89,13 @@ docker run -it --rm -v /c/Users/Carlos/pro/odtp-mobility-simulation/odtp-input:/
8989

9090
## Changelog
9191

92+
- v0.1.1
93+
- Client updated to v0.1.2
94+
- Github action for dockerhub publishing inlcuded
95+
- Added fix when building on windows
96+
9297
- v0.1.0
93-
- Initial relase
98+
- Initial release
9499

95100
## Development.
96101

odtp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
component-name: odtp-mobility-simulation
22
component-author: Ye Hong & Carlos Vivar Rios
3-
component-version: 0.1.0
3+
component-version: v0.1.1
44
component-repository: https://github.com/odtp-org/odtp-mobility-simulation
55
component-license: AGPL-3.0
66
component-type: ephemeral

0 commit comments

Comments
 (0)