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

Adopt Developer & Architecture Ethos #77

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
43a2a86
implement type safety, config encapsulation, accelerate code, module …
usrbinkat Sep 13, 2024
9c3431f
operationalize version locking, customization, prescedence, distribut…
usrbinkat Sep 14, 2024
1e1dd48
add documentation
usrbinkat Sep 14, 2024
acbaf28
nit documentation
usrbinkat Sep 14, 2024
1b79f35
refactor code for docs and docstrings
usrbinkat Sep 14, 2024
f0c651b
improve developer experience
usrbinkat Sep 14, 2024
edcc1de
improve developer experience
usrbinkat Sep 14, 2024
4b1159b
improve developer experience
usrbinkat Sep 14, 2024
edeb00c
improve developer experience
usrbinkat Sep 14, 2024
c01ad84
improve developer experience
usrbinkat Sep 14, 2024
db3c16e
streamline iac entrypoint main.py
usrbinkat Sep 15, 2024
aa9764c
refactor kubevirt module
usrbinkat Sep 15, 2024
713cd1d
refactor kubevirt module
usrbinkat Sep 15, 2024
ed88832
working transform
usrbinkat Sep 16, 2024
c5107df
return compliance configuration
usrbinkat Sep 16, 2024
461217f
add sample config
usrbinkat Sep 16, 2024
1714788
add sample config
usrbinkat Sep 16, 2024
f5c3a85
simplify wip
usrbinkat Sep 16, 2024
6c50c32
rerefactor optimization - working state
usrbinkat Sep 20, 2024
28bf6ed
refactor file tree layout
usrbinkat Sep 20, 2024
d42272b
refactor file tree layout
usrbinkat Sep 20, 2024
565040e
add code of conduct and contributor docs
usrbinkat Sep 21, 2024
8f2f4aa
refine core and module codebase
usrbinkat Sep 21, 2024
0252bfb
refine core and module codebase
usrbinkat Sep 21, 2024
3044f70
refine core and module codebase
usrbinkat Sep 21, 2024
4100b8e
add documentation
usrbinkat Sep 21, 2024
408238f
tidy core
usrbinkat Sep 21, 2024
fc9b357
core names
usrbinkat Sep 21, 2024
965740b
refactoring core module
usrbinkat Sep 21, 2024
31c0580
adopt new resource_helpers for metadata propagation compliance
usrbinkat Sep 22, 2024
4c23f1c
adopt new resource_helpers for metadata propagation compliance
usrbinkat Sep 22, 2024
d606183
adopt new resource_helpers for metadata propagation compliance
usrbinkat Sep 22, 2024
a3e0396
add default enabled config
usrbinkat Sep 22, 2024
ca878a1
add default enabled config
usrbinkat Sep 22, 2024
4dd658c
refactoring centralized metadata propagation enforcement + parent/dep…
usrbinkat Sep 23, 2024
000b711
refactor / bring multus online in new code architecture
usrbinkat Sep 23, 2024
01aa4e7
refactor multus + hostpath_provisioner
usrbinkat Sep 23, 2024
b55272c
return version
usrbinkat Sep 23, 2024
afa98f3
successful cdi deploy
usrbinkat Sep 24, 2024
40dbd8d
add prometheus
usrbinkat Sep 24, 2024
1d21cf3
add prometheus
usrbinkat Sep 24, 2024
ee160e5
add developer comments, questions, planning, and TODOs
usrbinkat Sep 24, 2024
2960274
add developer comments, questions, planning, and TODOs
usrbinkat Sep 24, 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
62 changes: 46 additions & 16 deletions .github/bin/delete-namespace
Original file line number Diff line number Diff line change
@@ -1,36 +1,66 @@
#!/bin/bash

# Delete all resources in namespace
set -euo pipefail

# Function to delete all resources in a namespace
delete_resources_in_namespace() {
local namespace=$1
echo "Deleting all resources in namespace: $namespace"
kubectl api-resources --verbs=list --namespaced -o name \
| xargs -n 1 kubectl delete --all -n "$namespace" --ignore-not-found --wait
}

# Remove finalizers and delete stuck namespace
delete_namespace() {
# Function to remove finalizers from a namespace
remove_finalizers() {
local namespace=$1
echo "Removing finalizers and deleting namespace: $namespace"
echo "Removing finalizers from namespace: $namespace"
kubectl get namespace "$namespace" -o json \
| jq 'del(.spec.finalizers)' \
| kubectl replace --raw "/api/v1/namespaces/$namespace/finalize" -f -
kubectl delete namespace "$namespace"
}

# Function to delete a namespace
delete_namespace() {
local namespace=$1
echo "Deleting namespace: $namespace"
kubectl delete namespace "$namespace" --ignore-not-found --wait
echo "Waiting for namespace $namespace to be deleted..."
while kubectl get namespace "$namespace" &>/dev/null; do
sleep 1
done
echo "Namespace $namespace has been deleted."
}

# Check for at least one namespace provided as argument
if [ $# -eq 0 ]; then
echo "Usage: $0 <namespace1> <namespace2> ... <namespaceN>"
exit 1
fi

# Loop through and delete list of namespaces
for namespace in "$@"; do
delete_resources_in_namespace "$namespace"
delete_namespace "$namespace"
done
# Function to delete CustomResourceDefinitions (CRDs)
delete_crds() {
local crds=("certificaterequests.cert-manager.io" "certificates.cert-manager.io" "challenges.acme.cert-manager.io" \
"orders.acme.cert-manager.io" "clusterissuers.cert-manager.io" "issuers.cert-manager.io" \
"kubevirts.kubevirt.io")

for crd in "${crds[@]}"; do
echo "Deleting CRD: $crd"
kubectl delete crd "$crd" --ignore-not-found --wait
done
}

# Main deletion process
main() {
if [ $# -eq 0 ]; then
echo "Usage: $0 <namespace1> <namespace2> ... <namespaceN>"
exit 1
fi

for namespace in "$@"; do
delete_resources_in_namespace "$namespace"
remove_finalizers "$namespace" || echo "Failed to remove finalizers for namespace: $namespace"
delete_namespace "$namespace" || {
echo "Namespace $namespace is stuck. Attempting to force removal."
remove_finalizers "$namespace"
delete_namespace "$namespace"
}
done

delete_crds
}

main "$@"
103 changes: 103 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [[email protected]](mailto:[email protected]). All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression towards or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.

---

## Reporting Guide

To make sure everyone understands how to report a Code of Conduct violation, here are some detailed instructions:

1. **Write down what happened.**
- Include the times and dates of incidents if possible.
- Remember, if you feel any aspect of this experience might help make things better for the community, it is worth reporting.

2. **Submit your report.**
- You can report via email: [[email protected]](mailto:[email protected]).

3. **Wait for response.**
- You should get a response from us within a few days. We take every report seriously and will inform you of any steps we will be taking as a result of your complaint.

## Values and Principles

At ContainerCraft, our core principles revolve around creating an inclusive, safe, and growth-oriented community. We believe that each individual has the potential to contribute meaningfully, and we strive to provide an environment that fosters learning, respect, and collaboration. We commit to:

- Continually improve community health and inclusivity.
- Promote a culture where new ideas are welcome, and learning from mistakes is encouraged.
- Prioritize the safety and well-being of our members above all else.

Thank you for helping to make this a welcoming and respectful community for all.
183 changes: 183 additions & 0 deletions CONTRIBUTOR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# Contributing to Kargo

First off, thank you for your interest in Kargo! The Kargo project is designed to provide a delightful Developer Experience (DX) and User Experience (UX), and we welcome contributions from the community to help continue this mission. Whether you're fixing a bug, adding a new feature, or improving documentation, your contributions are greatly appreciated.

---

## Table of Contents

1. [Code of Conduct](#code-of-conduct)
2. [Getting Started](#getting-started)
- [Prerequisites](#prerequisites)
- [Setting up Development Environment](#setting-up-development-environment)
3. [How to Contribute](#how-to-contribute)
- [Reporting Bugs](#reporting-bugs)
- [Suggesting Enhancements](#suggesting-enhancements)
- [Submitting Changes](#submitting-changes)
4. [Style Guides](#style-guides)
- [Python Style Guide](#python-style-guide)
- [Commit Messages](#commit-messages)
- [Documentation](#documentation)
5. [Testing](#testing)
6. [Continuous Integration](#continuous-integration)
7. [Communication](#communication)
8. [Acknowledgements](#acknowledgements)
9. [Additional Resources](#additional-resources)

---

## Code of Conduct

This project adheres to the [Contributor Covenant Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [[email protected]](mailto:[email protected]).

---

## Getting Started

### Prerequisites

- **Github Account**:
- **Docker / Docker Desktop**:
- **VSCode**:
- **VSCode | Devcontainer Extension**:

### Setting up Development Environment

1. **Fork the Repository**:
- Navigate to the [Kargo GitHub repository](https://github.com/your-org/kargo) and click "Fork".

2. **Clone the Forked Repository**:
```sh
git clone https://github.com/your-username/kargo.git
cd kargo
```

3. **Launch VSCode**:

> NOTE: When prompted, relaunch in devcontainer wich will supply all dependencies.

```sh
code .
```

4. **Login & Install Dependencies**:
```sh
pulumi login
pulumi install
```

5. **Configure Pre-commit Hooks**:
```sh
pip install pre-commit
pre-commit install
```

---

## How to Contribute

### Reporting Bugs

If you've found a bug, please open an issue on GitHub. Fill out the provided template with as much detail as possible, including:
- The version of Kargo you're using
- Steps to reproduce the bug
- Any relevant logs or screenshots

### Suggesting Enhancements

To suggest an enhancement, please open an issue with the "enhancement" label. Provide a clear description of the improvement and why it would be beneficial for the project.

### Submitting Changes

1. **Create a Branch**:
```sh
git checkout -b feature/user/my-new-feature
```

2. **Make Your Changes**:
- Ensure your code adheres to the [Python Style Guide](#python-style-guide).
- Write tests to cover your changes.

3. **Commit Your Changes**:
```sh
git add .
git commit -m "feat: add new feature"
```

4. **Push to Your Fork**:
```sh
git push origin user/feature/my-new-feature
```

5. **Open a Pull Request**:
- Navigate to the repository on GitHub and click "Compare & pull request". Fill in the template and submit.

---

## Style Guides

### Python Style Guide

Adhere to [PEP 8](https://www.python.org/dev/peps/pep-0008/) and aim for clean, readable code. We recommend using `flake8` and `black` to maintain code quality:
```sh
pip install flake8 black
flake8 .
black .
```

### Commit Messages

- Follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
- Example Commit Message:
```
feat: add support for Kubernetes 1.24

This commit adds compatibility with Kubernetes 1.24, ensuring all API changes are accommodated.
```

### Documentation

- Use clear and concise docstrings for functions and classes.
- Update `README.md` and other relevant documentation files as applicable.

---

## Testing

1. **Unit Tests**: Your code should be accompanied by unit tests to ensure robust coverage.
2. **Running Tests**:
```sh
pytest
```

---

## Continuous Integration

We use GitHub Actions for CI/CD. All pull requests will be automatically tested. Please ensure your PR passes all checks before requesting a review.

---

## Communication

- **GitHub Issues**: For proposing features, reporting bugs, and suggesting improvements.
- **Email**: For sensitive or private communication, please contact [[email protected]](mailto:[email protected]).

---

## Acknowledgements

Thank you to all the contributors who make this project possible. Your time and effort are sincerely appreciated!

---

## Additional Resources

- [Pulumi Documentation](https://www.pulumi.com/docs/)
- [Kubernetes Documentation](https://kubernetes.io/docs/)
- [Contributor Covenant Code of Conduct](https://www.contributor-covenant.org/)
- [GitHub Actions Documentation](https://docs.github.com/en/actions)

---

Thank you for contributing to Kargo!
Loading
Loading