Skip to content

Commit

Permalink
Remove K3D and Dapr (#10)
Browse files Browse the repository at this point in the history
* Remove K3D and Dapr
* Normalize package name to velocitas-lib
  • Loading branch information
BjoernAtBosch committed Apr 9, 2024
1 parent e60e935 commit df5339e
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# SPDX-License-Identifier: Apache-2.0

FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.2
FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3

COPY scripts/*.sh /tmp/scripts/
RUN find /tmp/scripts/ -type f -iname "*.sh" -exec chmod +x {} \;
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
generate-dash: true

- name: Setup Java JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
Expand All @@ -64,7 +64,7 @@ jobs:
java -jar dash.jar clearlydefined.input -summary DEPENDENCIES
- name: Upload dash input/output as artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: "dash-artifacts"
Expand Down
20 changes: 12 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
unit-test:
name: "Run unit tests"
runs-on: ubuntu-22.04
container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.1
container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3

steps:
- name: Checkout repository
Expand Down Expand Up @@ -75,13 +75,17 @@ jobs:
update_check: true
annotate_only: true

- uses: 5monkeys/cobertura-action@v13
- uses: irongut/[email protected]
with:
path: results/CodeCoverage/cobertura-coverage.xml
minimum_coverage: 80
show_line: true
show_branch: true
fail_below_threshold: false
filename: results/CodeCoverage/cobertura-coverage.xml
badge: true
format: markdown
hide_complexity: true
indicators: true
output: both

- run: |
cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
ensure-docs-up2date:
name: Ensure docs are up2date
Expand All @@ -91,7 +95,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dist
build
logs
results
helm
.pytest_cache

mkdocs.yml
Expand Down
10 changes: 5 additions & 5 deletions NOTICE-3RD-PARTY-CONTENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
## Python
| Dependency | Version | License |
|:-----------|:-------:|--------:|
|types-requests|2.31.0.20240403|Apache 2.0|
|types-requests|2.31.0.20240406|Apache 2.0|
|urllib3|2.2.1|MIT|
## Workflows
| Dependency | Version | License |
|:-----------|:-------:|--------:|
|5monkeys/cobertura-action|v13|MIT License|
|actions/checkout|v4|MIT License|
|actions/setup-java|v3|MIT License|
|actions/setup-python|v4|MIT License|
|actions/upload-artifact|v3|MIT License|
|actions/setup-java|v4|MIT License|
|actions/setup-python|v5|MIT License|
|actions/upload-artifact|v4|MIT License|
|irongut/CodeCoverageSummary|v1.3.0|MIT License|
|mikepenz/action-junit-report|v4|Apache License 2.0|
|pre-commit/action|v3.0.0|MIT License|
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

- [`middleware.MiddlewareType`](./velocitas_lib.middleware.md#class-middlewaretype): Enumeration containing all possible middleware types.
- [`services.Service`](./velocitas_lib.services.md#class-service): Service(id, config)
- [`services.ServiceSpecConfig`](./velocitas_lib.services.md#class-servicespecconfig): ServiceSpecConfig(image, is_enabled, env_vars, use_dapr, args, ports, port_forwards, mounts, startup_log_patterns)
- [`services.ServiceSpecConfig`](./velocitas_lib.services.md#class-servicespecconfig): ServiceSpecConfig(image, is_enabled, env_vars, args, ports, port_forwards, mounts, startup_log_patterns)
- [`variables.ProjectVariables`](./velocitas_lib.variables.md#class-projectvariables)

## Functions
Expand Down
2 changes: 1 addition & 1 deletion docs/velocitas_lib.middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

---

<a href="../velocitas_lib/middleware.py#L25"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/middleware.py#L24"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_middleware_type`

Expand Down
14 changes: 7 additions & 7 deletions docs/velocitas_lib.services.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

---

<a href="../velocitas_lib/services.py#L42"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/services.py#L41"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `resolve_functions`

Expand All @@ -25,7 +25,7 @@ resolve_functions(input_str: str) → str

---

<a href="../velocitas_lib/services.py#L76"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/services.py#L75"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `parse_service_config`

Expand All @@ -48,7 +48,7 @@ Parse service spec configuration and return it as an named tuple.

---

<a href="../velocitas_lib/services.py#L150"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/services.py#L140"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_services`

Expand All @@ -61,7 +61,7 @@ Return all specified services as Python object.

---

<a href="../velocitas_lib/services.py#L191"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/services.py#L181"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_specific_service`

Expand All @@ -80,7 +80,7 @@ Return the specified service as Python object.

---

<a href="../velocitas_lib/services.py#L208"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/services.py#L198"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>function</kbd> `get_service_port`

Expand All @@ -102,15 +102,15 @@ Return the service port as string for the specified service.
<a href="../velocitas_lib/services.py#L25"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `ServiceSpecConfig`
ServiceSpecConfig(image, is_enabled, env_vars, use_dapr, args, ports, port_forwards, mounts, startup_log_patterns)
ServiceSpecConfig(image, is_enabled, env_vars, args, ports, port_forwards, mounts, startup_log_patterns)





---

<a href="../velocitas_lib/services.py#L37"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../velocitas_lib/services.py#L36"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

## <kbd>class</kbd> `Service`
Service(id, config)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "velocitas_lib"
version = "0.0.3"
name = "velocitas-lib"
version = "0.1.0"
dependencies = [
"requests >= 2.31.0",
"types-requests"
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ pytest-asyncio==0.20.3
pytest-cov==4.0.0
types-mock==4.0.15.2
pyfakefs==5.2.2
velocitas_lib
velocitas-lib
1 change: 0 additions & 1 deletion velocitas_lib/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class MiddlewareType(Enum):
"""Enumeration containing all possible middleware types."""

NATIVE = 0
DAPR = 1


def get_middleware_type() -> MiddlewareType:
Expand Down
10 changes: 0 additions & 10 deletions velocitas_lib/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class ServiceSpecConfig(NamedTuple):
image: str
is_enabled: bool = True
env_vars: Dict[str, Optional[str]] = dict()
use_dapr: bool = True
args: List[str] = list()
ports: List[str] = list()
port_forwards: List[str] = list()
Expand Down Expand Up @@ -84,7 +83,6 @@ def parse_service_config(
"""

is_enabled = True
use_dapr = True
container_image = None
env_vars = dict[str, Optional[str]]()
ports = []
Expand Down Expand Up @@ -113,13 +111,6 @@ def parse_service_config(
env_vars[inner_key] = None
if len(pair) > 1:
env_vars[inner_key] = pair[1].strip()
elif key == "no-dapr":
if isinstance(value, str):
use_dapr = not value == "true"
elif isinstance(value, bool):
use_dapr = not value
else:
raise ValueError("Unsupported value type!")
elif key == "arg":
args.append(value)
elif key == "port":
Expand All @@ -138,7 +129,6 @@ def parse_service_config(
image=container_image,
is_enabled=is_enabled,
env_vars=env_vars,
use_dapr=use_dapr,
args=args,
ports=ports,
port_forwards=port_forwards,
Expand Down

0 comments on commit df5339e

Please sign in to comment.