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

chore: introduce server-ai package #35

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
37 changes: 37 additions & 0 deletions .github/ISSUE_TEMPLATE/package-server-ai--bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: LaunchDarkly.ServerSdk.Ai Bug report
about: Create a report to help us improve
title: ''
labels: 'package: sdk/server-ai, bug'
assignees: ''

---

**Is this a support request?**
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/hc/en-us/requests/new) or by emailing [email protected].

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

**Describe the bug**
A clear and concise description of what the bug is.

**To reproduce**
Steps to reproduce the behavior.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Logs**
If applicable, add any log output related to your problem.

**Server SDK & AI package version**
The version of the AI package, as well as the version of the server-side SDK.

**Language version, developer tools**
For instance, .NET 6.0.

**OS/platform**
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/package-server-ai--feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: LaunchDarkly.ServerSdk.Ai Feature request
about: Suggest an idea for this project
title: ''
labels: 'package: sdk/server-ai, feature'
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
40 changes: 40 additions & 0 deletions .github/workflows/sdk-server-ai-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: LaunchDarkly.ServerSdk.Ai CI
on:
push:
branches: [main, 'feat/**']
paths-ignore:
- '**.md' # Do not need to run CI for markdown changes.
pull_request:
branches: [main, 'feat/**']
paths-ignore:
- '**.md'

jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4

- name: Setup Env from project's Env file
shell: bash
run: echo "$(cat pkgs/sdk/server-ai/github_actions.env)" >> $GITHUB_ENV

- uses: launchdarkly/gh-actions/actions/[email protected]
name: Get secrets
with:
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}

- uses: ./.github/actions/ci
with:
project_file: ${{ env.PROJECT_FILE}}

- uses: ./.github/actions/build-docs
with:
workspace_path: ${{ env.WORKSPACE_PATH}}
10 changes: 10 additions & 0 deletions LaunchDarkly.ServerSdk.sln
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchDarkly.ServerSdk.Tele
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestService", "pkgs\sdk\server\contract-tests\TestService.csproj", "{72D0898F-4CD9-42B7-B3B4-5CFD23796C47}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "server-ai", "server-ai", "{A52FE37A-BCDD-4FC0-A8BA-7576721EA217}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LaunchDarkly.ServerSdk.Ai", "pkgs\sdk\server-ai\src\LaunchDarkly.ServerSdk.Ai.csproj", "{89B5D359-6BC8-4CD0-B17D-D68A435ABBB2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -47,6 +51,10 @@ Global
{72D0898F-4CD9-42B7-B3B4-5CFD23796C47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{72D0898F-4CD9-42B7-B3B4-5CFD23796C47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{72D0898F-4CD9-42B7-B3B4-5CFD23796C47}.Release|Any CPU.Build.0 = Release|Any CPU
{89B5D359-6BC8-4CD0-B17D-D68A435ABBB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{89B5D359-6BC8-4CD0-B17D-D68A435ABBB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{89B5D359-6BC8-4CD0-B17D-D68A435ABBB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{89B5D359-6BC8-4CD0-B17D-D68A435ABBB2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -63,5 +71,7 @@ Global
{35014C04-26CE-43B0-933D-35D80CF0E6B8} = {7A984A5D-0C83-42FA-8BF7-DCA2441F62DA}
{71299584-BF0D-48A4-B2E1-D6292036D48D} = {7A984A5D-0C83-42FA-8BF7-DCA2441F62DA}
{72D0898F-4CD9-42B7-B3B4-5CFD23796C47} = {FDA973CE-26F2-4745-AF19-0873F170C4CF}
{A52FE37A-BCDD-4FC0-A8BA-7576721EA217} = {0A3F3CFA-1CBB-49BD-BCD3-4A53E3D08665}
{89B5D359-6BC8-4CD0-B17D-D68A435ABBB2} = {A52FE37A-BCDD-4FC0-A8BA-7576721EA217}
EndGlobalSection
EndGlobal
3 changes: 3 additions & 0 deletions pkgs/sdk/server-ai/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# docfx output directories
api
docs
67 changes: 67 additions & 0 deletions pkgs/sdk/server-ai/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Contributing to the LaunchDarkly AI SDK (server-side) for .NET

LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/sdk/concepts/contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.

## Submitting bug reports and feature requests

The LaunchDarkly SDK team monitors the [issue tracker](https://github.com/launchdarkly/dotnet-core/issues) in the SDK repository. Bug reports and feature requests specific to this SDK should be filed in this issue tracker. The SDK team will respond to all newly filed issues within two business days.

## Submitting pull requests

We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days.

## Build instructions

### Prerequisites
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These docs are all TBD.


To set up your SDK build time environment, you must [download .NET development tools and follow the instructions](https://dotnet.microsoft.com/download).

The AI SDK wraps the [Server-Side](../server) SDK.

### Building

To install all required packages:

```bash
dotnet restore
```

Then, to build the SDK for all target frameworks:

```bash
dotnet build src/LaunchDarkly.ServerSdk.Ai
```

Or, in Linux:

```bash
make
```

Or, to build for only one target framework (in this example, .NET Standard 2.0):

```bash
dotnet build src/LaunchDarkly.ServerSdk.Ai -f netstandard2.0
```

### Testing

To run all unit tests:

```bash
dotnet test test/LaunchDarkly.ServerSdk.Ai.Tests/LaunchDarkly.ServerSdk.Ai.Tests.csproj
```

Or, in Linux:

```bash
make test
```

Note that the unit tests can only be run in Debug configuration. There is an `InternalsVisibleTo` directive that allows the test code to access internal members of the library, and assembly strong-naming in the Release configuration interferes with this.

## Documentation in code

All public types, methods, and properties should have documentation comments in the standard C# XML comment format. These will be automatically included in the documentation that is generated on release; this process also uses additional Markdown content from the respective packages `docs-src/` subdirectory.

See [`docs-src/README.md`](./docs-src/README.md) for more details.
Binary file added pkgs/sdk/server-ai/LaunchDarkly.pk
Binary file not shown.
8 changes: 8 additions & 0 deletions pkgs/sdk/server-ai/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
build:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: I copied over this makefile from server, but these don't actually work because the csproj is in the src folder.

dotnet build

test:
dotnet test

clean:
dotnet clean
66 changes: 66 additions & 0 deletions pkgs/sdk/server-ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# LaunchDarkly AI SDK (server-side) for .NET

The LaunchDarkly AI SDK (server-side) for .NET is designed primarily for use in multi-user systems such as web servers and applications. It follows the server-side LaunchDarkly model for multi-user contexts. It is not intended for use in desktop and embedded systems applications.

Currently there is no client-side AI SDK for .NET. If you're interested, please let us know by filing an issue!

## LaunchDarkly overview

[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

## Supported .NET versions

This version of the AI SDK is built for the following targets:

* .NET 7.0: runs on .NET 7.0 and above (including higher major versions).
Copy link
Contributor Author

@cwaldren-ld cwaldren-ld Nov 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: I wrote .NET 7.0, but this should actually be 6.0 for the immediate future like the server (and in not so distant future, 8.0)

* .NET Framework 4.6.2: runs on .NET Framework 4.6.2 and above.
* .NET Standard 2.0: runs in any project that is targeted to .NET Standard 2.x rather than to a specific runtime platform.

The .NET build tools should automatically load the most appropriate build of the SDK for whatever platform your application or library is targeted to.

## Getting started

Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/dotnet#getting-started) for instructions on getting started with using the SDK.

## Signing

The published version of this assembly is digitally signed with Authenticode and [strong-named](https://docs.microsoft.com/en-us/dotnet/framework/app-domains/strong-named-assemblies). Building the code locally in the default Debug configuration does not use strong-naming and does not require a key file. The public key file is in this repository at `LaunchDarkly.pk` as well as here:

```
Public Key:
0024000004800000940000000602000000240000525341310004000001000100f121bbf427e4d7
edc64131a9efeefd20978dc58c285aa6f548a4282fc6d871fbebeacc13160e88566f427497b625
56bf7ff01017b0f7c9de36869cc681b236bc0df0c85927ac8a439ecb7a6a07ae4111034e03042c
4b1569ebc6d3ed945878cca97e1592f864ba7cc81a56b8668a6d7bbe6e44c1279db088b0fdcc35
52f746b4

Public Key Token: f86add69004e6885
```

## Learn more

TODO(cwaldren): update reference docs links

Read our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/server-side/dotnet).

The authoritative description of all types, properties, and methods is in the [generated API documentation](https://launchdarkly.github.io/dotnet-core/pkgs/sdk/server).

## Contributing

We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK.

## About LaunchDarkly

* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
* Explore LaunchDarkly
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
48 changes: 48 additions & 0 deletions pkgs/sdk/server-ai/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"metadata": [
{
"src": [
{
"src": "./src",
"files": [
"**/*.csproj",
"**/bin/**/**LaunchDarkly**.dll"
]
}
],
"dest": "./api",
"properties" : {
"Configuration": "Debug"
},
}
],
"build": {
"content": [
{
"files": [
"**/*.{md,yml}"
],
"exclude": [
"docs/**"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"output": "docs",
"template": [
"default"
],
"globalMetadata": {
"_appName": "LaunchDarkly Dotnet Server AI SDK",
"_appTitle": "LaunchDarkly Dotnet Server AI SDK",
"_enableSearch": true,
"pdf": false
}
}
}
5 changes: 5 additions & 0 deletions pkgs/sdk/server-ai/github_actions.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
WORKSPACE_PATH=pkgs/sdk/server-ai
PROJECT_FILE=pkgs/sdk/server-ai/src/LaunchDarkly.ServerSdk.Ai.csproj
BUILD_OUTPUT_PATH=pkgs/sdk/server-ai/src/bin/Release/
BUILD_OUTPUT_DLL_NAME=LaunchDarkly.ServerSdk.Ai.dll
TEST_PROJECT_FILE=pkgs/sdk/server-ai/test/LaunchDarkly.ServerSdk.Ai.Tests.csproj
19 changes: 19 additions & 0 deletions pkgs/sdk/server-ai/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
_layout: landing
---

# LaunchDarkly Server-Side AI SDK for .NET

For first time users, visit our [LaunchDarkly Docs](https://docs.launchdarkly.com/sdk/server-side/dotnet) page.


This site contains the full API reference for the [`LaunchDarkly.ServerSdk.Ai`](https://www.nuget.org/packages/LaunchDarkly.ServerSdk.Ai).

For source code, see the [GitHub repository](https://github.com/launchdarkly/dotnet-core).
The [developer notes](https://github.com/launchdarkly/dotnet-core/blob/main/CONTRIBUTING.md) there include links
to other repositories used in the SDK.


## Namespaces

**[LaunchDarkly.Sdk.Ai](docs-src/namespaces/LaunchDarkly.Sdk.Ai.md):** The base namespace for all LaunchDarkly .NET-based SDKs, containing common types.
Loading
Loading