Skip to content

Commit

Permalink
chore: rename & initial setup
Browse files Browse the repository at this point in the history
Signed-off-by: Toma Puljak <[email protected]>
  • Loading branch information
Tpuljak committed Jul 5, 2024
1 parent 89abb2c commit 2662ee4
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Daytona Provider Sample",
"name": "Daytona AWS Provider",
"image": "ghcr.io/daytonaio/go-devcontainer:main",
"containerEnv": {
"LOG_LEVEL": "debug"
Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ The team at Daytona welcomes contributions from the community. There are many wa

## Provide Feedback

You might find things that can be improved while you are using the Daytona Provider Sample. You can help by [submitting an issue](https://github.com/daytonaio/daytona-provider-sample/issues/new) when:
You might find things that can be improved while you are using the Daytona AWS Provider. You can help by [submitting an issue](https://github.com/daytonaio/daytona-provider-aws/issues/new) when:

* When the Provider Sample crashes or you encounter a bug that can only be resolved by restarting Daytona.
* When the AWS Provider crashes or you encounter a bug that can only be resolved by restarting Daytona.
* An error occurs that is unrecoverable, causes workspace integrity problems or loss, or generally prevents you from using a workspace.
* A new feature or an enhancement to an existing feature will improve the utility or usability of the Daytona Provider Sample.
* A new feature or an enhancement to an existing feature will improve the utility or usability of the Daytona AWS Provider.

Before creating a new issue, please confirm that an existing issue doesn't already exist.

Expand All @@ -22,15 +22,15 @@ You can engage with our community by:
* Authoring new dev containers and sharing examples

## Contributing Code
You can contribute to the Daytona Provider Sample by:
You can contribute to the Daytona AWS Provider by:

* Enhancing current functionality
* Fixing bugs
* Adding new features and capabilities

Before starting your contribution, especially for core features, we encourage you to reach out to us on [Slack](https://join.slack.com/t/daytonacommunity/shared_invite/zt-273yohksh-Q5YSB5V7tnQzX2RoTARr7Q). This allows us to ensure that your proposed feature aligns with the project's roadmap and goals. Developers are the key to making Daytona the best tool it can be, and we value input from the community.

We look forward to working with you to improve Daytona and the Provider Sample, and make development environments as easy as possible for developers everywhere.
We look forward to working with you to improve Daytona and the AWS Provider, and make development environments as easy as possible for developers everywhere.

### Steps to Contribute Code

Expand All @@ -39,7 +39,7 @@ Follow the following steps to ensure your contribution goes smoothly.
1. Read and follow the steps outlined in the [Daytona Contributing Policy](README.md#contributing).
2. Configure your development environment by either following the guide below.
3. [Fork](https://help.github.com/articles/working-with-forks/) the GitHub Repository allowing you to make the changes in your own copy of the repository.
4. Create a [GitHub issue](https://github.com/daytonaio/daytona-provider-sample/issues) if one doesn't exist already.
4. Create a [GitHub issue](https://github.com/daytonaio/daytona-provider-aws/issues) if one doesn't exist already.
5. [Prepare your changes](/PREPARING_YOUR_CHANGES.md) and ensure your commits are descriptive. The document contains an optional commit template, if desired.
6. Ensure that you sign off on all your commits to comply with the DCO v1.1. We have more details in [Prepare your changes](/PREPARING_YOUR_CHANGES.md).
7. Create a pull request on GitHub. If you're new to GitHub, read about [pull requests](https://help.github.com/articles/about-pull-requests/). You are welcome to submit your pull request for commentary or review before it is complete by creating a [draft pull request](https://help.github.com/en/articles/about-pull-requests#draft-pull-requests). Please include specific questions or items you'd like feedback on.
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<div align="center">

[![License](https://img.shields.io/badge/License-MIT-blue)](#license)
[![Go Report Card](https://goreportcard.com/badge/github.com/daytonaio/daytona-provider-sample)](https://goreportcard.com/report/github.com/daytonaio/daytona-provider-sample)
[![Issues - daytona](https://img.shields.io/github/issues/daytonaio/daytona-provider-sample)](https://github.com/daytonaio/daytona-provider-sample/issues)
![GitHub Release](https://img.shields.io/github/v/release/daytonaio/daytona-provider-sample)
[![Go Report Card](https://goreportcard.com/badge/github.com/daytonaio/daytona-provider-aws)](https://goreportcard.com/report/github.com/daytonaio/daytona-provider-aws)
[![Issues - daytona](https://img.shields.io/github/issues/daytonaio/daytona-aws-provider)](https://github.com/daytonaio/daytona-provider-aws/issues)
![GitHub Release](https://img.shields.io/github/v/release/daytonaio/daytona-aws-provider)

</div>


<h1 align="center">Daytona Provider Sample</h1>
<h1 align="center">Daytona AWS Provider</h1>
<div align="center">
This repository is the home of the <a href="https://github.com/daytonaio/daytona">Daytona</a> Provider Sample.
This repository is the home of the <a href="https://github.com/daytonaio/daytona">Daytona</a> AWS Provider.
</div>
</br>

> [!NOTE]
> After you create a repository, you can run `./hack/replace-name.sh` to easily configure the repo based on the name of your provider. Feel free to remove the `hack` folder after that.
<p align="center">
<a href="https://github.com/daytonaio/daytona-provider-sample/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=%F0%9F%90%9B+Bug+Report%3A+">Report Bug</a>
<a href="https://github.com/daytonaio/daytona-provider-aws/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=%F0%9F%90%9B+Bug+Report%3A+">Report Bug</a>
·
<a href="https://github.com/daytonaio/daytona-provider-sample/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=%F0%9F%9A%80+Feature%3A+">Request Feature</a>
<a href="https://github.com/daytonaio/daytona-provider-aws/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.md&title=%F0%9F%9A%80+Feature%3A+">Request Feature</a>
·
<a href="https://go.daytona.io/slack">Join Our Slack</a>
·
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/daytonaio/daytona-provider-sample
module github.com/daytonaio/daytona-provider-aws

go 1.22.2

Expand Down
51 changes: 0 additions & 51 deletions hack/replace-name.sh

This file was deleted.

4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/hashicorp/go-hclog"
hc_plugin "github.com/hashicorp/go-plugin"

p "github.com/daytonaio/daytona-provider-sample/pkg/provider"
p "github.com/daytonaio/daytona-provider-aws/pkg/provider"
)

func main() {
Expand All @@ -20,7 +20,7 @@ func main() {
hc_plugin.Serve(&hc_plugin.ServeConfig{
HandshakeConfig: manager.ProviderHandshakeConfig,
Plugins: map[string]hc_plugin.Plugin{
"provider-sample": &provider.ProviderPlugin{Impl: &p.SampleProvider{}},
"aws-provider": &provider.ProviderPlugin{Impl: &p.AWSProvider{}},
},
Logger: logger,
})
Expand Down
43 changes: 20 additions & 23 deletions pkg/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import (
"encoding/json"
"io"

internal "github.com/daytonaio/daytona-provider-sample/internal"
log_writers "github.com/daytonaio/daytona-provider-sample/internal/log"
provider_types "github.com/daytonaio/daytona-provider-sample/pkg/types"
internal "github.com/daytonaio/daytona-provider-aws/internal"
log_writers "github.com/daytonaio/daytona-provider-aws/internal/log"
provider_types "github.com/daytonaio/daytona-provider-aws/pkg/types"

"github.com/daytonaio/daytona/pkg/logs"
"github.com/daytonaio/daytona/pkg/provider"
"github.com/daytonaio/daytona/pkg/provider/util"
"github.com/daytonaio/daytona/pkg/workspace"
)

type SampleProvider struct {
type AWSProvider struct {
BasePath *string
DaytonaDownloadUrl *string
DaytonaVersion *string
Expand All @@ -24,12 +24,9 @@ type SampleProvider struct {
ApiPort *uint32
ServerPort *uint32
NetworkKey *string
OwnProperty string
}

func (p *SampleProvider) Initialize(req provider.InitializeProviderRequest) (*util.Empty, error) {
p.OwnProperty = "my-own-property"

func (p *AWSProvider) Initialize(req provider.InitializeProviderRequest) (*util.Empty, error) {
p.BasePath = &req.BasePath
p.DaytonaDownloadUrl = &req.DaytonaDownloadUrl
p.DaytonaVersion = &req.DaytonaVersion
Expand All @@ -43,18 +40,18 @@ func (p *SampleProvider) Initialize(req provider.InitializeProviderRequest) (*ut
return new(util.Empty), nil
}

func (p SampleProvider) GetInfo() (provider.ProviderInfo, error) {
func (p AWSProvider) GetInfo() (provider.ProviderInfo, error) {
return provider.ProviderInfo{
Name: "provider-sample",
Name: "aws-provider",
Version: internal.Version,
}, nil
}

func (p SampleProvider) GetTargetManifest() (*provider.ProviderTargetManifest, error) {
func (p AWSProvider) GetTargetManifest() (*provider.ProviderTargetManifest, error) {
return provider_types.GetTargetManifest(), nil
}

func (p SampleProvider) GetDefaultTargets() (*[]provider.ProviderTarget, error) {
func (p AWSProvider) GetDefaultTargets() (*[]provider.ProviderTarget, error) {
info, err := p.GetInfo()
if err != nil {
return nil, err
Expand All @@ -70,7 +67,7 @@ func (p SampleProvider) GetDefaultTargets() (*[]provider.ProviderTarget, error)
return &defaultTargets, nil
}

func (p SampleProvider) CreateWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
func (p AWSProvider) CreateWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
logWriter := io.MultiWriter(&log_writers.InfoLogWriter{})
if p.LogsDir != nil {
loggerFactory := logs.NewLoggerFactory(*p.LogsDir)
Expand All @@ -84,19 +81,19 @@ func (p SampleProvider) CreateWorkspace(workspaceReq *provider.WorkspaceRequest)
return new(util.Empty), nil
}

func (p SampleProvider) StartWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
func (p AWSProvider) StartWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
return new(util.Empty), nil
}

func (p SampleProvider) StopWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
func (p AWSProvider) StopWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
return new(util.Empty), nil
}

func (p SampleProvider) DestroyWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
func (p AWSProvider) DestroyWorkspace(workspaceReq *provider.WorkspaceRequest) (*util.Empty, error) {
return new(util.Empty), nil
}

func (p SampleProvider) GetWorkspaceInfo(workspaceReq *provider.WorkspaceRequest) (*workspace.WorkspaceInfo, error) {
func (p AWSProvider) GetWorkspaceInfo(workspaceReq *provider.WorkspaceRequest) (*workspace.WorkspaceInfo, error) {
providerMetadata, err := p.getWorkspaceMetadata(workspaceReq)
if err != nil {
return nil, err
Expand All @@ -123,7 +120,7 @@ func (p SampleProvider) GetWorkspaceInfo(workspaceReq *provider.WorkspaceRequest
return workspaceInfo, nil
}

func (p SampleProvider) CreateProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
func (p AWSProvider) CreateProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
logWriter := io.MultiWriter(&log_writers.InfoLogWriter{})
if p.LogsDir != nil {
loggerFactory := logs.NewLoggerFactory(*p.LogsDir)
Expand All @@ -137,19 +134,19 @@ func (p SampleProvider) CreateProject(projectReq *provider.ProjectRequest) (*uti
return new(util.Empty), nil
}

func (p SampleProvider) StartProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
func (p AWSProvider) StartProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
return new(util.Empty), nil
}

func (p SampleProvider) StopProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
func (p AWSProvider) StopProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
return new(util.Empty), nil
}

func (p SampleProvider) DestroyProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
func (p AWSProvider) DestroyProject(projectReq *provider.ProjectRequest) (*util.Empty, error) {
return new(util.Empty), nil
}

func (p SampleProvider) GetProjectInfo(projectReq *provider.ProjectRequest) (*workspace.ProjectInfo, error) {
func (p AWSProvider) GetProjectInfo(projectReq *provider.ProjectRequest) (*workspace.ProjectInfo, error) {
providerMetadata := provider_types.ProjectMetadata{
Property: projectReq.Project.Name,
}
Expand All @@ -169,7 +166,7 @@ func (p SampleProvider) GetProjectInfo(projectReq *provider.ProjectRequest) (*wo
return projectInfo, nil
}

func (p SampleProvider) getWorkspaceMetadata(workspaceReq *provider.WorkspaceRequest) (string, error) {
func (p AWSProvider) getWorkspaceMetadata(workspaceReq *provider.WorkspaceRequest) (string, error) {
metadata := provider_types.WorkspaceMetadata{
Property: workspaceReq.Workspace.Id,
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
daytona_provider "github.com/daytonaio/daytona/pkg/provider"
"github.com/daytonaio/daytona/pkg/workspace"

"github.com/daytonaio/daytona-provider-sample/pkg/provider"
provider_types "github.com/daytonaio/daytona-provider-sample/pkg/types"
"github.com/daytonaio/daytona-provider-aws/pkg/provider"
provider_types "github.com/daytonaio/daytona-provider-aws/pkg/types"
)

var sampleProvider = &provider.SampleProvider{}
var sampleProvider = &provider.AWSProvider{}
var targetOptions = &provider_types.TargetOptions{
RequiredString: "default-required-string",
}
Expand Down

0 comments on commit 2662ee4

Please sign in to comment.