diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml new file mode 100644 index 00000000..40c0bbee --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -0,0 +1,59 @@ +name: Bug report +description: Create a report to help us improve +title: "" +labels: [bug] +assignees: "" +body: + - type: markdown + attributes: + value: "Thanks for taking the time to fill out this bug report!" + - type: textarea + id: describe-bug + attributes: + label: Describe the bug + description: A clear and concise description of what the bug is. + placeholder: "Tell us what happens instead of the expected behavior..." + render: markdown + validations: + required: true + - type: textarea + id: reproduce-steps + attributes: + label: Steps to reproduce the behavior + description: "Please share the steps to reproduce the issue:" + placeholder: | + 1. Go to '...' + 2. Click on '...' + 3. Scroll down to '...' + 4. See error + render: markdown + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected behavior + description: A clear and concise description of what you expected to happen. + placeholder: "Explain what you expected to happen..." + render: markdown + validations: + required: true + - type: markdown + attributes: + value: "You can add screenshots or additional context below." + - type: file + id: screenshots + attributes: + label: Screenshots + description: If applicable, add screenshots to help explain your problem. + validations: + required: false + - type: textarea + id: additional-context + attributes: + label: Additional context + description: Add any other context about the problem here. + placeholder: "Any other information or context..." + render: markdown + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml new file mode 100644 index 00000000..906ff5d3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -0,0 +1,46 @@ +name: Feature request +description: Suggest an idea for this project +title: "" +labels: [] +assignees: "" +body: + - type: markdown + attributes: + value: "Thanks for suggesting a feature! Please fill out the form below." + - type: textarea + id: problem-description + attributes: + label: Is your feature request related to a problem? Please describe. + description: A clear and concise description of what the problem is. For example: "I'm always frustrated when..." + placeholder: "Describe the problem or the frustration..." + render: markdown + validations: + required: true + - type: textarea + id: desired-solution + attributes: + label: Describe the solution you'd like + description: A clear and concise description of what you want to happen. + placeholder: "Explain your ideal solution..." + render: markdown + validations: + required: true + - type: textarea + id: alternatives-considered + attributes: + label: Describe alternatives you've considered + description: A clear and concise description of any alternative solutions or features you've considered. + placeholder: "List any alternative solutions or features..." + render: markdown + validations: + required: false + - type: markdown + attributes: + value: "If you have any additional context or screenshots, you can add them below." + - type: file + id: additional-context + attributes: + label: Additional context or screenshots + description: Add any other context or screenshots about the feature request here. + validations: + required: false diff --git a/.github/ISSUE_TEMPLATE/question.yaml b/.github/ISSUE_TEMPLATE/question.yaml new file mode 100644 index 00000000..17711316 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yaml @@ -0,0 +1,27 @@ +name: Question +description: Post a question about the project +title: "" +labels: [question] +assignees: "" +body: + - type: markdown + attributes: + value: "Have a question about the project? Feel free to ask it here!" + - type: textarea + id: your-question + attributes: + label: Your Question + description: A clear and concise question. + placeholder: "What would you like to ask?" + render: markdown + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: Additional Context + description: Add any other context about your question here. + placeholder: "Provide additional information or context if necessary..." + render: markdown + validations: + required: false diff --git a/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md new file mode 100644 index 00000000..6e7660d8 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md @@ -0,0 +1,25 @@ +--- +name: Pull Request +about: A pull request +title: '' +labels: '' +assignees: '' +--- + +[pull_requests]: https://github.com/controlplaneio/simulator/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc + + + +**All Submissions.** + +- [ ] Have you followed the guidelines in our [Contributing document](../../CONTRIBUTING.md)? +- [ ] Have you checked to ensure there aren't other open [Pull Requests][pull_requests] for the same update/change? + +**Code Submissions.** + +- [ ] Does your submission pass linting, tests, and security analysis? + +**Changes to Core Features.** + +- [ ] Have you added an explanation of what your changes do and why you'd like us to include them? +- [ ] Have you written new tests for your core changes, as applicable? diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..cd2a2ad2 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,72 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, +religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers 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, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by contacting Andrew Martin andy(at)control-plane.io. +All complaints will be reviewed and investigated and will result in a response that is deemed +necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of +an incident. Further details of specific enforcement policies may be +posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..179ee290 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,182 @@ +# Contributing to Simulator + +👍🎉 We're thrilled that you're interested in contributing! 🎉👍 + +`Simulator` is under Apache 2.0 license and welcomes contributions through GitHub pull requests. + +This document provides guidelines for contributing to `Simulator`. While we adhere to certain standards to maintain quality, we welcome your PRs and are happy to collaborate to make them fit our standards. Suggestions for improving this guide are also welcome via pull requests. + +## Table Of Contents + +- [Code of Conduct](#code-of-conduct) +- [I Don't Want To Read This Whole Thing I Just Have a Question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question) +- [What Should I Know Before I Get Started?](#what-should-i-know-before-i-get-started) +- [How Can I Contribute?](#how-can-i-contribute) + - [Reporting Bugs](#reporting-bugs) + - [Before Submitting a Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit a (Good) Bug Report?](#how-do-i-submit-a-good-bug-report) + - [Suggesting Enhancements](#suggesting-enhancements) + - [Before Submitting an Enhancement Suggestion](#before-submitting-an-enhancement-suggestion) + - [How Do I Submit A (Good) Enhancement Suggestion?](#how-do-i-submit-a-good-enhancement-suggestion) + - [Your First Code Contribution](#your-first-code-contribution) + - [Development](#development) + - [Pull Requests](#pull-requests) +- [Style Guides](#style-guides) + - [Git Commit Messages](#git-commit-messages) + - [General Style Guide](#general-style-guide) + - [GoLang Style Guide](#golang-style-guide) + - [Documentation Style Guide](#documentation-style-guide) + +--- + +## Code of Conduct + +All participants in this project are governed by our [Code of Conduct](CODE_OF_CONDUCT.md). We expect everyone to abide by this code. Please report any unacceptable behavior to [andy@control-plane.io](mailto:andy@control-plane.io.). + +## I Don't Want To Read This Whole Thing I Just Have a Question!!! + +We have an official message board with a detailed FAQ and where the community chimes in with helpful advice if you have questions. + +We also have an issue template for questions [here](https://github.com/controlplaneio/simulator/issues/new). + +## What Should I Know Before I Get Started? + +The Simulator project is centered around a single central repo - [Simulator](https://github.com/controlplaneio/simulator). This is the core component of the project, encompassing all functionalities of the Simulator. Feel free to explore the repository to understand more about how the Simulator works and where you might be able to contribute. + +## How Can I Contribute? + +### Reporting Bugs + +This section guides you through submitting a bug report for `Simulator`. Following these guidelines helps maintainers and the +community understand your report, reproduce the behaviour, and find related reports. + +Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you +don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). +Fill out the issue template for bugs, the information it asks for helps us resolve issues faster. + +> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue +> and include a link to the original issue in the body of your new one. + +#### Before Submitting a Bug Report + +- **Perform a [cursory search](https://github.com/search?q=+is:issue+user:controlplaneio)** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one + +#### How Do I Submit a (Good) Bug Report? + +Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on that repository and provide the following information by filling in the issue template [here](https://github.com/controlplaneio/simulator/issues/new). + +Explain the problem and include additional details to help maintainers reproduce the problem: + +- **Use a clear and descriptive title** for the issue to identify the problem +- **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started `simulator` and what you did until you noticed an error or the unexpected behaviour. Additional commmands, configuration files and logs, can help us better understand the problem. +- **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines). +- **Describe the behaviour you observed after following the steps** and point out what exactly is the problem with that behaviour +- **Explain which behaviour you expected to see instead and why.** + +Provide more context by answering these questions: + +- **Did the problem start happening recently** (e.g. after updating to a new version of Simulator) or was this always a problem ? +- If the problem started happening recently, **can you reproduce the problem in an older version of Simulator?** What is the most recent version in which the problem does not happen? You can download older versions of Simulator from [the releases page](https://github.com/controlplaneio/simulator/releases) +- **Can you reliably reproduce the issue?** If not, please provide details about how often the problem happens and under which conditions it normally happens + +### Suggesting Enhancements + +This section guides you through submitting an enhancement suggestion for Simulator, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions. + +Before creating enhancement suggestions, please check [this list](#before-submitting-an-enhancement-suggestion) as you might find out that you don't need to create one. When you are creating an enhancement suggestion, please [include as many details as possible](#how-do-i-submit-a-good-enhancement-suggestion). Fill in the template feature request template, including the steps that you imagine you would take if the feature you're requesting existed. + +#### Before Submitting an Enhancement Suggestion + +- **Perform a [cursory search](https://github.com/search?q=+is:issue+user:controlplaneio)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. + +#### How Do I Submit A (Good) Enhancement Suggestion? + +Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue on this +repository and provide the following information: + +- **Use a clear and descriptive title** for the issue to identify the suggestion +- **Provide a step-by-step description of the suggested enhancement** in as many details as possible +- **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines) +- **Describe the current behaviour** and **explain which behaviour you expected to see instead** and why ? +- **Explain why this enhancement would be useful** to most Simulator users and isn't something that can or should be implemented + as a separate community project +- **List some other tools where this enhancement exists.** +- **Specify which version of Simulator you're using.** You can get the exact version by running `simulator version` in your terminal +- **Specify the name and version of the OS you're using.** + +### Your First Code Contribution + +Unsure where to begin contributing to `Simulator`? You can start by looking through these `Good First Issue` and `Help Wanted` +issues: + +- [Good First Issue issues][good_first_issue] - issues which should only require a few lines of code, and a test or two +- [Help wanted issues][help_wanted] - issues which should be a bit more involved than `Good First Issue` issues + +Both issue lists are sorted by total number of comments. While not perfect, number of comments is a reasonable proxy for impact a given change will have. + +#### Development + +- Simulator is written in [Go programming language](https://golang.org/doc/). +- Please follow the instructions [here](https://go.dev/doc/install) to install Go on your machine +- Please install `golangcli-lint` by following the instructions [here](https://golangci-lint.run/usage/install/#local-installation) + +### Pull Requests + +The process described here has several goals: + +- Maintain the quality of `Simulator` +- Fix problems that are important to users +- Engage the community in working toward the best possible Simulator +- Enable a sustainable system for Simulator's maintainers to review contributions + +Please follow these steps to have your contribution considered by the maintainers: + + + +1. Follow all instructions in the template +2. Follow the [style guides](#style-guides) +3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) + are passing +
+ What if the status checks are failing? + If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on + the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for + you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our + status check suite. +
+ + + +While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to +complete additional tests, or other changes before your pull request can be ultimately accepted. + +## Style Guides + +### Git Commit Messages + +- It's strongly preferred you [GPG Verify][commit_signing] your commits if you can +- Follow [Conventional Commits](https://www.conventionalcommits.org) +- Use the present tense ("add feature" not "added feature") +- Use the imperative mood ("move cursor to..." not "moves cursor to...") +- Limit the first line to 72 characters or less +- Reference issues and pull requests liberally after the first line + +### General Style Guide + +Look at installing an `.editorconfig` plugin or configure your editor to match the `.editorconfig` file in the root of the +repository. + +### GoLang Style Guide + +All Go code is linted with [golangci-lint](https://golangci-lint.run/). + +For formatting rely on `gofmt` to handle styling. + +### Documentation Style Guide + +All markdown code is linted with [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli). + +[good_first_issue]:https://github.com/controlplaneio/simulator/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22+sort%3Acomments-desc +[help_wanted]: https://github.com/controlplaneio/simulator/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22 + +[commit_signing]: https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/managing-commit-signature-verification \ No newline at end of file diff --git a/Makefile b/Makefile index 7f44c2cd..1d309bc9 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,19 @@ SIMULATOR_IMAGE ?= controlplane/simulator -lint: +.PHONY: help +help: ## Show this help message + @awk 'BEGIN {FS = ":.*?##"} /^[a-zA-Z_-]+:.*?##/ { sub("\\\\", "", $$1); printf "\033[36m%-30s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) + +lint: ## Lint the code golangci-lint run -c .golangci.yml -simulator-dev-image: lint +simulator-dev-image: lint ## Lint the code and build the development Docker image docker build -t $(SIMULATOR_IMAGE):dev -f dev.Dockerfile . -simulator-image: simulator-dev-image +simulator-image: simulator-dev-image ## Build the Docker image for the simulator docker build -t $(SIMULATOR_IMAGE) . -simulator-cli: lint +simulator-cli: lint ## Build the simulator CLI go build -v -o bin/simulator cmd/simulator/main.go + +build: simulator-dev-image simulator-image simulator-cli ## Build docker images and the CLI binary diff --git a/README.md b/README.md index 251927b3..2aee10a0 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,25 @@ # Standalone simulator -A distributed systems and infrastructure simulator for attacking and debugging Kubernetes +`Simulator` is an open source distributed systems and infrastructure simulator for attacking and debugging Kubernetes. + +## Download + +Please download the latest release from the [releases page](https://github.com/controlplaneio/simulator/releases) + +## Prerequisites + +- [Docker](https://docs.docker.com/get-docker/) +- [Terraform](https://www.terraform.io/downloads.html) +- [Packer](https://www.packer.io/downloads) + +## Usage + +1. Build the container image for the simulator + +```bash + make simulator-image +``` -1. Build the container image and cli 2. Build the AMIs 3. Configure the cli 4. Provision the infrastructure diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..1ba76f1b --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +## Our Security Address + +Contact: `security@control-plane.io` +Encryption: `https://keybase.io/sublimino/pgp_keys.asc` +Disclosure: `Full`