Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create python sdk #1

Merged
merged 73 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
08313f6
Initial version
GabyUnalaq Sep 18, 2024
b124534
Remove unnecessary files
GabyUnalaq Sep 18, 2024
fbac2f9
Move AnkaiosSDK out of src folder
GabyUnalaq Sep 18, 2024
379295f
Add Manifest and other fixes
GabyUnalaq Sep 20, 2024
2b0abe1
Finalize testing: 100% coverage and 10/10 lint
GabyUnalaq Sep 24, 2024
6ff6ce3
Update README.md
GabyUnalaq Sep 24, 2024
e17f99f
Delete old read function
GabyUnalaq Sep 25, 2024
626ce19
Fix sdk setup
GabyUnalaq Sep 25, 2024
9341862
Fix protobuf versioning warning
GabyUnalaq Sep 25, 2024
339e887
Add CI verification
GabyUnalaq Sep 25, 2024
95c5d34
Update versions for CI
GabyUnalaq Sep 25, 2024
fbae064
Update versions for CI
GabyUnalaq Sep 25, 2024
c7b5b53
Update MANIFEST.in
GabyUnalaq Sep 25, 2024
8d97e15
Refactor to follow PEP8 and update tests
GabyUnalaq Sep 26, 2024
303fa68
Fix CI verification
GabyUnalaq Sep 26, 2024
9e50953
Fix CI verification
GabyUnalaq Sep 26, 2024
79288ec
Fix CI verification cache version
GabyUnalaq Sep 26, 2024
4603e86
Fix test names and pylint
GabyUnalaq Sep 26, 2024
b6d2d62
Merge branch 'main' of github.com:GabyUnalaq/ank-sdk-python into ank-…
GabyUnalaq Sep 26, 2024
f397361
Prepare publish and release jobs
GabyUnalaq Sep 27, 2024
25febbe
Change workflow name
GabyUnalaq Sep 27, 2024
ab8a518
Fix publish workflow
GabyUnalaq Sep 27, 2024
901b6c9
Add contributor files
GabyUnalaq Oct 1, 2024
7f866a6
Update description of sdk
GabyUnalaq Oct 3, 2024
8b89b3f
Fix workload.update_workload_name
GabyUnalaq Oct 3, 2024
11d72eb
Improve workload logic
GabyUnalaq Oct 4, 2024
32d6fb6
Prepare the configs implementation
GabyUnalaq Oct 7, 2024
4e51a81
Add allow and deny rules to the workload
GabyUnalaq Oct 8, 2024
139cbb4
Update README.md
GabyUnalaq Oct 8, 2024
cf5bf94
Add documentation
GabyUnalaq Oct 9, 2024
885cf2d
Fix findings
GabyUnalaq Oct 10, 2024
276e508
Add automatic fetching of proto files from release
GabyUnalaq Oct 10, 2024
325c180
Fix dependencies
GabyUnalaq Oct 10, 2024
1d5fc6b
Fix get_workload_states_for_name
GabyUnalaq Oct 10, 2024
0c06ad4
Additional fixes to the docs
GabyUnalaq Oct 11, 2024
469109d
Add doc generation to build workflow
GabyUnalaq Oct 11, 2024
0e5029d
Fix docs build dir generation
GabyUnalaq Oct 11, 2024
fbfc1c4
Simplify docs conf.py code
GabyUnalaq Oct 11, 2024
2f45176
Findings: Return value is WorkloadInstanceName
GabyUnalaq Oct 18, 2024
cd499b1
Add custom exceptions
GabyUnalaq Oct 18, 2024
2eabc44
Update protos. Config implementation
GabyUnalaq Oct 21, 2024
98e894b
Fix findings
GabyUnalaq Oct 21, 2024
b9dbd37
Update README.md
GabyUnalaq Oct 22, 2024
f872cc2
Fix findings
GabyUnalaq Oct 25, 2024
c915448
Move connect to init of ankaios
GabyUnalaq Oct 25, 2024
e565d93
Fix findings
GabyUnalaq Oct 25, 2024
6942c34
Add getting started doc page
GabyUnalaq Oct 25, 2024
99599a6
Fix minor issues about the docs
GabyUnalaq Oct 25, 2024
90a1ec2
Fix findings
GabyUnalaq Oct 28, 2024
e4965c6
Fix Getting started doc
GabyUnalaq Oct 28, 2024
90c61f2
Update README.md
GabyUnalaq Oct 28, 2024
13fb48e
Github actions improvements
GabyUnalaq Oct 28, 2024
e853348
Make code compatible with Python 3.9
GabyUnalaq Oct 29, 2024
02722be
Small fix
GabyUnalaq Oct 29, 2024
1ff7c37
Small fix
GabyUnalaq Oct 29, 2024
66bbc68
Fix ReadMe
GabyUnalaq Oct 29, 2024
6c28519
Fix reading of Ankaios version
GabyUnalaq Oct 29, 2024
472b701
Fix connection problem
GabyUnalaq Oct 29, 2024
a33d82d
Small fix
GabyUnalaq Oct 29, 2024
ffe1062
Add docs README
GabyUnalaq Oct 29, 2024
57eba9c
Small fix for ReadMe
GabyUnalaq Oct 29, 2024
71da4c8
Fix getting started examples
GabyUnalaq Oct 29, 2024
db0e8f7
Add more logs to the sdk
GabyUnalaq Oct 29, 2024
8732df4
Small fix regarding logs
GabyUnalaq Oct 29, 2024
ba950cf
Fix reading thread bug
GabyUnalaq Oct 29, 2024
58e2b24
Fix config in manifest
GabyUnalaq Oct 29, 2024
72892a8
Fix CompleteState._to_proto()
GabyUnalaq Oct 30, 2024
f00dc5e
Added to_dict for complete state
GabyUnalaq Oct 30, 2024
049f574
Fix request empty masks
GabyUnalaq Oct 31, 2024
e4776e1
Implement configurations
GabyUnalaq Nov 4, 2024
c6a666b
Fix manifest check
GabyUnalaq Nov 4, 2024
c0ad591
Fix manifest with configs
GabyUnalaq Nov 4, 2024
fd1feea
Fix findings
GabyUnalaq Nov 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ""
labels: bug
assignees: ''

---

<!--- Provide a general summary of the issue in the Title above -->

## Current Behavior
<!--- What is actually happening -->

## Expected Behavior
<!--- What should happen -->

## Steps to Reproduce
<!-- Provide a detailed set of steps to reproduce the bug. -->

1.
2.
3.
4.

## Context (Environment)

<!-- Provide some context to the bug, e.g. on which platform, with which account, ... -->

## Logs
<!-- Please share as many logs as possible. This will help to debug -->
<!-- If logs are long, considering putting them in a [gist](https://gist.github.com/) and adding the link here. This helps keep this issue report smaller. -->
<!-- Don't forget to remove any connection string information! -->

## Additional Information
<!-- Please provide any additional information that may be helpful in understanding the issue. -->

## Final result
<!-- Before filling in the final result, summarize the use-case and/or workflow in a comment and discuss it with the committers -->

**To be filled by the one closing the issue.**
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/enchancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Enhancement
about: Enhancement with goals and optional tasks
title: ""
labels: enhancement
assignees: ''

---

## Description

<!-- provide a description of the enhancement -->

## Goals

<!-- describe the goals you want to achieve with this enhancement -->

## Final result
<!-- Before filling in the final result, summarize the use-case and/or workflow in a comment and discuss it with the committers -->

### Summary

**To be filled when the final solution is sketched.**

### Tasks

<!--
An optional lists of tasks that need to be executed
By using the list syntax ("[ ]"), github can track and visualize progress on the story.
-->

- [ ] Task 1
- [ ] Task 2
- [ ] ...
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Issues: #

<!-- Description of the change in case no issue is mentioned -->

# Definition of Done

The PR shall be merged only if all items mentioned in [CONTRIBUTING.md](https://github.com/eclipse-ankaios/ankaios/blob/main/CONTRIBUTING.md#how-to-contribute) have been followed. In case an item is not applicable as described, please provide a short explanation in the description.

- [ ] All steps in [CONTRIBUTING.md](https://github.com/eclipse-ankaios/ankaios/blob/main/CONTRIBUTING.md#how-to-contribute) have been handled
208 changes: 208 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
name: Build and run tests

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
workflow_call:

jobs:
setup:
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-deps.outputs.cache-hit }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: |
~/.cache/pip
key: python-deps-${{ runner.os }}-${{ hashFiles('setup.py', 'setup.cfg') }}
restore-keys: |
python-deps-${{ runner.os }}-

- name: Install dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
python3 -m pip install --upgrade pip
pip install .[dev]

unit_test:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-deps-${{ runner.os }}-${{ hashFiles('setup.py', 'setup.cfg') }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]

- name: Run unit tests
run: python3 run_checks.py --utest
continue-on-error: true

- name: Upload unit test report
uses: actions/upload-artifact@v4
with:
name: unit-test-report
path: reports/utest

coverage:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-deps-${{ runner.os }}-${{ hashFiles('setup.py', 'setup.cfg') }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]

- name: Run coverage
run: python3 run_checks.py --cov
continue-on-error: true

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: reports/coverage

lint:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-deps-${{ runner.os }}-${{ hashFiles('setup.py', 'setup.cfg') }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]

- name: Run lint
run: python3 run_checks.py --lint
continue-on-error: true

- name: Upload lint report
uses: actions/upload-artifact@v4
with:
name: pylint-report
path: reports/pylint

codestyle:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-deps-${{ runner.os }}-${{ hashFiles('setup.py', 'setup.cfg') }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]

- name: Run pep8 codestyle check
run: python3 run_checks.py --pep8
continue-on-error: true

- name: Upload codestyle report
uses: actions/upload-artifact@v4
with:
name: codestyle-report
path: reports/codestyle

docs:
needs: setup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-deps-${{ runner.os }}-${{ hashFiles('setup.py', 'setup.cfg') }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[docs]

- name: Generate documentation
run: |
cd docs
make html
cd ..

- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: docs_html
path: docs/build/html
44 changes: 44 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish to Pypi

on:
workflow_dispatch:
workflow_call:

jobs:
build:
uses: ./.github/workflows/build.yml

publish:
needs: build
permissions: write-all
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Restore cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: python-deps-${{ runner.os }}-${{ hashFiles('setup.py', 'setup.cfg') }}

- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install .[dev]
pip install twine

- name: Build package
run: |
python3 setup.py sdist bdist_wheel

- name: Publish package to Pypi
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Loading