Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions .github/workflows/create-release.yml
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
8 changes: 8 additions & 0 deletions .gitignore
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
1,365 changes: 1,365 additions & 0 deletions ATTRIBUTION.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ If you discover a potential security issue in this project we ask that you notif

## Licensing

See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
See the [LICENSE](/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
24 changes: 24 additions & 0 deletions GOVERNANCE.md
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)
23 changes: 23 additions & 0 deletions Makefile
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}'
1 change: 1 addition & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

4 changes: 4 additions & 0 deletions OWNERS
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
9 changes: 9 additions & 0 deletions OWNERS_ALIASES
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
27 changes: 18 additions & 9 deletions README.md
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.
3 changes: 3 additions & 0 deletions SECURITY.md
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.
14 changes: 14 additions & 0 deletions generator.yaml
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
16 changes: 16 additions & 0 deletions go.mod
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 added go.sum
Empty file.
8 changes: 8 additions & 0 deletions metadata.yaml
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/
Copy link
Contributor Author

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.

api_versions:
- api_version: v1alpha1
status: available
42 changes: 42 additions & 0 deletions olm/olmconfig.yaml
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 added templates/.gitkeep
Empty file.
4 changes: 4 additions & 0 deletions test/e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
__pycache__/
*.py[cod]
**/bootstrap.yaml
**/bootstrap.pkl
34 changes: 34 additions & 0 deletions test/e2e/__init__.py
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)
32 changes: 32 additions & 0 deletions test/e2e/bootstrap_resources.py
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
45 changes: 45 additions & 0 deletions test/e2e/conftest.py
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')
18 changes: 18 additions & 0 deletions test/e2e/replacement_values.py
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 = {
}
1 change: 1 addition & 0 deletions test/e2e/requirements.txt
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 added test/e2e/resources/.gitkeep
Empty file.
39 changes: 39 additions & 0 deletions test/e2e/service_bootstrap.py
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)
Loading