generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 4
Bootstrap Controller #1
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: Create Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
|
|
||
| permissions: | ||
| contents: write # For creating releases | ||
|
|
||
| jobs: | ||
| call-create-release: | ||
| uses: aws-controllers-k8s/.github/.github/workflows/reusable-create-release.yaml@main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .DS_Store | ||
| *.swp | ||
| *~ | ||
| .idea | ||
| bin | ||
| build | ||
| .env | ||
| READ_BEFORE_COMMIT.md |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Project governance | ||
|
|
||
| This document lays out the guidelines under which the AWS Controllers for Kubernetes (ACK) project will be governed. | ||
| The goal is to make sure that the roles and responsibilities are well defined and clarify on how decisions are made. | ||
|
|
||
| ## Communication | ||
|
|
||
| The primary mechanism for communication will be via the `#aws-controllers-k8s` channel on the Kubernetes Slack community. | ||
| All features and bug fixes will be tracked as issues in GitHub. All decisions will be documented in GitHub issues. | ||
|
|
||
| In the future, we may consider using a public mailing list, which can be better archived. | ||
|
|
||
| ## Roadmap Planning | ||
|
|
||
| Maintainers will share roadmap and release versions as milestones in GitHub. | ||
|
|
||
| ## Release Management | ||
|
|
||
| The Advisory Board will propose a release management proposal via a GitHub issue and resolve it there. | ||
|
|
||
| ## Other relevant governance resources | ||
|
|
||
| * The ACK [Contributing Guidelines](CONTRIBUTING.md) | ||
| * Our [Code of Conduct](CODE_OF_CONDUCT.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| SHELL := /bin/bash # Use bash syntax | ||
|
|
||
| # Set up variables | ||
| GO111MODULE=on | ||
|
|
||
| # Build ldflags | ||
| VERSION ?= "v0.0.0" | ||
| GITCOMMIT=$(shell git rev-parse HEAD) | ||
| BUILDDATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') | ||
| GO_LDFLAGS=-ldflags "-X main.version=$(VERSION) \ | ||
| -X main.buildHash=$(GITCOMMIT) \ | ||
| -X main.buildDate=$(BUILDDATE)" | ||
|
|
||
| .PHONY: all test | ||
|
|
||
| all: test | ||
|
|
||
| test: ## Run code tests | ||
| go test -v ./... | ||
|
|
||
| help: ## Show this help. | ||
| @grep -F -h "##" $(MAKEFILE_LIST) | grep -F -v grep | sed -e 's/\\$$//' \ | ||
| | awk -F'[:#]' '{print $$1 = sprintf("%-30s", $$1), $$4}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| # See the OWNERS docs at https://go.k8s.io/owners | ||
|
|
||
| approvers: | ||
| - core-ack-team |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # See the OWNERS docs at https://go.k8s.io/owners#owners_aliases | ||
|
|
||
| aliases: | ||
| core-ack-team: | ||
| - a-hilaly | ||
| - jlbutler | ||
| - michaelhtm | ||
| - rushmash91 | ||
| - knottnt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,26 @@ | ||
| ## My Project | ||
| # ACK service controller for Agents for Amazon Bedrock | ||
|
|
||
| TODO: Fill this README out! | ||
| This repository contains source code for the AWS Controllers for Kubernetes | ||
| (ACK) service controller for . | ||
|
|
||
| Be sure to: | ||
| Please [log issues][ack-issues] and feedback on the main AWS Controllers for | ||
| Kubernetes Github project. | ||
|
|
||
| * Change the title in this README | ||
| * Edit your repository description on GitHub | ||
| [ack-issues]: https://github.com/aws/aws-controllers-k8s/issues | ||
|
|
||
| ## Security | ||
| ## Contributing | ||
|
|
||
| See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. | ||
| We welcome community contributions and pull requests. | ||
|
|
||
| ## License | ||
| See our [contribution guide](/CONTRIBUTING.md) for more information on how to | ||
| report issues, set up a development environment, and submit code. | ||
|
|
||
| We adhere to the [Amazon Open Source Code of Conduct][coc]. | ||
|
|
||
| You can also learn more about our [Governance](/GOVERNANCE.md) structure. | ||
|
|
||
| This project is licensed under the Apache-2.0 License. | ||
| [coc]: https://aws.github.io/code-of-conduct | ||
|
|
||
| ## License | ||
|
|
||
| This project is [licensed](/LICENSE) under the Apache-2.0 License. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # Security issue notifications | ||
|
|
||
| If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| sdk_names: | ||
| model_name: bedrock-agent | ||
| ignore: | ||
| resource_names: | ||
| - Agent | ||
| - AgentActionGroup | ||
| - AgentAlias | ||
| - DataSource | ||
| - Flow | ||
| - FlowAlias | ||
| - FlowVersion | ||
| - KnowledgeBase | ||
| - Prompt | ||
| - PromptVersion |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| module github.com/aws-controllers-k8s/bedrock-agent-controller | ||
|
|
||
| go 1.24.2 | ||
|
|
||
| require ( | ||
| github.com/aws-controllers-k8s/runtime v0.45.0 | ||
| github.com/aws/aws-sdk-go v1.55.7 | ||
| github.com/aws/aws-sdk-go-v2 v1.36.3 | ||
| github.com/aws/smithy-go v1.22.2 | ||
| github.com/go-logr/logr v1.4.2 | ||
| github.com/spf13/pflag v1.0.5 | ||
| k8s.io/api v0.32.1 | ||
| k8s.io/apimachinery v0.32.1 | ||
| k8s.io/client-go v0.32.1 | ||
| sigs.k8s.io/controller-runtime v0.20.4 | ||
| ) |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| service: | ||
| full_name: Amazon Bedrock | ||
| short_name: Bedrock | ||
| link: https://aws.amazon.com/bedrock/ | ||
| documentation: https://docs.aws.amazon.com/bedrock/ | ||
| api_versions: | ||
| - api_version: v1alpha1 | ||
| status: available | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| # This configuration is a placeholder. Replace any values with relevant values for your | ||
| # service controller project. | ||
| --- | ||
| annotations: | ||
| capabilityLevel: Basic Install | ||
| shortDescription: AWS Bedrock Agent controller is a service controller for managing Bedrock Agent resources | ||
| in Kubernetes | ||
| displayName: AWS Controllers for Kubernetes - Amazon Bedrock Agent | ||
| description: |- | ||
| Manage Amazon Bedrock Agent resources in AWS from within your Kubernetes cluster. | ||
|
|
||
|
|
||
| **About Amazon Bedrock Agent** | ||
|
|
||
|
|
||
| Amazon Bedrock is a fully managed service that makes high-performing foundation models (FMs) from leading AI companies and Amazon available for your use through a unified API. You can choose from a wide range of foundation models to find the model that is best suited for your use case. Amazon Bedrock also offers a broad set of capabilities to build generative AI applications with security, privacy, and responsible AI. Using Amazon Bedrock, you can easily experiment with and evaluate top foundation models for your use cases, privately customize them with your data using techniques such as fine-tuning and Retrieval Augmented Generation (RAG), and build agents that execute tasks using your enterprise systems and data sources. | ||
|
|
||
| With Amazon Bedrock's serverless experience, you can get started quickly, privately customize foundation models with your own data, and easily and securely integrate and deploy them into your applications using AWS tools without having to manage any infrastructure. | ||
|
|
||
|
|
||
| **About the AWS Controllers for Kubernetes** | ||
|
|
||
|
|
||
| This controller is a component of the [AWS Controller for Kubernetes](https://github.com/aws/aws-controllers-k8s) | ||
| project. This project is currently in **developer preview**. | ||
|
|
||
|
|
||
| **Pre-Installation Steps** | ||
|
|
||
|
|
||
| Please follow the following link: [Red Hat OpenShift](https://aws-controllers-k8s.github.io/community/docs/user-docs/openshift/) | ||
| samples: | ||
| - kind: ExampleCustomKind | ||
| spec: '{}' | ||
| - kind: SecondExampleCustomKind | ||
| spec: '{}' | ||
| maintainers: | ||
| - name: "bedrock-agent maintainer team" | ||
| email: "ack-maintainers@amazon.com" | ||
| links: | ||
| - name: Amazon Bedrock Agent Developer Resources | ||
| url: https://aws.amazon.com/Bedrock Agent/developer-resources/ |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| __pycache__/ | ||
| *.py[cod] | ||
| **/bootstrap.yaml | ||
| **/bootstrap.pkl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
| # not use this file except in compliance with the License. A copy of the | ||
| # License is located at | ||
| # | ||
| # http://aws.amazon.com/apache2.0/ | ||
| # | ||
| # or in the "license" file accompanying this file. This file is distributed | ||
| # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
| # express or implied. See the License for the specific language governing | ||
| # permissions and limitations under the License. | ||
|
|
||
| import pytest | ||
| from typing import Dict, Any | ||
| from pathlib import Path | ||
|
|
||
| from acktest.resources import load_resource_file | ||
|
|
||
| SERVICE_NAME = "bedrock-agent" | ||
| CRD_GROUP = "bedrock-agent.services.k8s.aws" | ||
| CRD_VERSION = "v1alpha1" | ||
|
|
||
| # PyTest marker for the current service | ||
| service_marker = pytest.mark.service(arg=SERVICE_NAME) | ||
|
|
||
| bootstrap_directory = Path(__file__).parent | ||
| resource_directory = Path(__file__).parent / "resources" | ||
|
|
||
| def load_bedrock-agent_resource(resource_name: str, additional_replacements: Dict[str, Any] = {}): | ||
| """ Overrides the default `load_resource_file` to access the specific resources | ||
| directory for the current service. | ||
| """ | ||
| return load_resource_file(resource_directory, resource_name, additional_replacements=additional_replacements) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
| # not use this file except in compliance with the License. A copy of the | ||
| # License is located at | ||
| # | ||
| # http://aws.amazon.com/apache2.0/ | ||
| # | ||
| # or in the "license" file accompanying this file. This file is distributed | ||
| # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
| # express or implied. See the License for the specific language governing | ||
| # permissions and limitations under the License. | ||
|
|
||
| """Declares the structure of the bootstrapped resources and provides a loader | ||
| for them. | ||
| """ | ||
|
|
||
| from dataclasses import dataclass | ||
| from acktest.bootstrapping import Resources | ||
| from e2e import bootstrap_directory | ||
|
|
||
| @dataclass | ||
| class BootstrapResources(Resources): | ||
| pass | ||
|
|
||
| _bootstrap_resources = None | ||
|
|
||
| def get_bootstrap_resources(bootstrap_file_name: str = "bootstrap.pkl") -> BootstrapResources: | ||
| global _bootstrap_resources | ||
| if _bootstrap_resources is None: | ||
| _bootstrap_resources = BootstrapResources.deserialize(bootstrap_directory, bootstrap_file_name=bootstrap_file_name) | ||
| return _bootstrap_resources |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
| # not use this file except in compliance with the License. A copy of the | ||
| # License is located at | ||
| # | ||
| # http://aws.amazon.com/apache2.0/ | ||
| # | ||
| # or in the "license" file accompanying this file. This file is distributed | ||
| # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
| # express or implied. See the License for the specific language governing | ||
| # permissions and limitations under the License. | ||
|
|
||
| import boto3 | ||
| import pytest | ||
|
|
||
| from acktest import k8s | ||
|
|
||
| def pytest_addoption(parser): | ||
| parser.addoption("--runslow", action="store_true", default=False, help="run slow tests") | ||
|
|
||
| def pytest_configure(config): | ||
| config.addinivalue_line( | ||
| "markers", "service(arg): mark test associated with a given service" | ||
| ) | ||
| config.addinivalue_line( | ||
| "markers", "slow: mark test as slow to run" | ||
| ) | ||
|
|
||
| def pytest_collection_modifyitems(config, items): | ||
| if config.getoption("--runslow"): | ||
| return | ||
| skip_slow = pytest.mark.skip(reason="need --runslow option to run") | ||
| for item in items: | ||
| if "slow" in item.keywords: | ||
| item.add_marker(skip_slow) | ||
|
|
||
| # Provide a k8s client to interact with the integration test cluster | ||
| @pytest.fixture(scope='class') | ||
| def k8s_client(): | ||
| return k8s._get_k8s_api_client() | ||
|
|
||
| @pytest.fixture(scope='module') | ||
| def bedrock-agent_client(): | ||
| return boto3.client('bedrock-agent') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
| # not use this file except in compliance with the License. A copy of the | ||
| # License is located at | ||
| # | ||
| # http://aws.amazon.com/apache2.0/ | ||
| # | ||
| # or in the "license" file accompanying this file. This file is distributed | ||
| # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
| # express or implied. See the License for the specific language governing | ||
| # permissions and limitations under the License. | ||
| """Stores the values used by each of the integration tests for replacing the | ||
| Bedrock Agent-specific test variables. | ||
| """ | ||
|
|
||
| REPLACEMENT_VALUES = { | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| acktest @ git+https://github.com/aws-controllers-k8s/test-infra.git@516d063715a5ae633ba1f6fe49dffd67543c6c84 |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"). You may | ||
| # not use this file except in compliance with the License. A copy of the | ||
| # License is located at | ||
| # | ||
| # http://aws.amazon.com/apache2.0/ | ||
| # | ||
| # or in the "license" file accompanying this file. This file is distributed | ||
| # on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
| # express or implied. See the License for the specific language governing | ||
| # permissions and limitations under the License. | ||
| """Bootstraps the resources required to run the Bedrock Agent integration tests. | ||
| """ | ||
| import logging | ||
|
|
||
| from acktest.bootstrapping import Resources, BootstrapFailureException | ||
|
|
||
| from e2e import bootstrap_directory | ||
| from e2e.bootstrap_resources import BootstrapResources | ||
|
|
||
| def service_bootstrap() -> Resources: | ||
| logging.getLogger().setLevel(logging.INFO) | ||
|
|
||
| resources = BootstrapResources( | ||
| # TODO: Add bootstrapping when you have defined the resources | ||
| ) | ||
|
|
||
| try: | ||
| resources.bootstrap() | ||
| except BootstrapFailureException as ex: | ||
| exit(254) | ||
|
|
||
| return resources | ||
|
|
||
| if __name__ == "__main__": | ||
| config = service_bootstrap() | ||
| # Write config to current directory by default | ||
| config.serialize(bootstrap_directory) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For controllers that are split-up should we point this at the API Reference specific to the controller's resources? For example this could be pointed at this link.