Giter Club home page Giter Club logo

multy's People

Contributors

abinmn avatar dependabot[bot] avatar goncalo-rodrigues avatar jcoelhoo avatar ksankeerth avatar mattvella07 avatar michidk avatar syanukov avatar szymonnogiec avatar tal66 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multy's Issues

Remove local engine dependencies (SQL, S3)

Allow Engine to locally run without third-party dependencies. This makes it easy for testing and getting started.

SQL - store Locks and API keys in-memory
S3 - use local file system

Output resource

Similar to terraform, we should have a resource that just prints a variable

Implement overrides for sizes and locations

Something like:

message VirtualNetworkArgs {
  ...
 
 message AwsOverrides {
    string vm_size = 1;
    string location = 2;
  }
 message AzureOverrides {
    string vm_size = 1;
    string location = 2;
  }
  AwsOverrides aws_overrides = 1;
  AzureOverrides azure_overrides = 2;
}

Which will then be used in the translation logic to override cloud-specific values.

Cross-cloud object_storage_object references

Support for cross-cloud object storage is dependent on:

  • Getting access to private resources from a different cloud: in azure this is done by a shared access signature; in aws there isn't any terraform support for it, but there is the concept of pre-signed urls (but not sure how to get one)
  • Add an interface or use CloudDependentResource to represent a resource in a given cloud and add mHcl support for it
  • Research how urls are passed around to understand if there is any way they are publicly accessible

Web app demo problems

  • If db is azure, it doesn't work
  • Aws runs the custom data script in root mode but azure doesn't (maybe we just need to make sure both clouds use the same vm image?)

Output cloud resource ids

For each resource, return the ids of the deployed resources.

For example, add fields to virtual_network.proto:

message VirtualNetworkResource {
  ...

  message Aws {
    string vpc_id = 1;
    string internet_gateway_id = 2;
    string default_security_group_id = 3;
  }

  message Azure {
    string virtual_network_id = 1;
    string route_table_id = 2;
  }
}

which will then be shown in the provider.

Allow hardcoded multi-id resources

In some cases, we can't handle hardcoded ids because multy resources depend on multiple properties of other resources.
For example, subnets depend on virtual_network.id, virtual_network.name and on the virtual network's associated route_table_id.

Currently, these ids can't be hardcoded and config must look like

multy virtual_network vn {
...
}
multy subnet example {
  virtual_network = vn
}

But we want to support hardcoded ids in these cases, which would look something like (schema details TBD)

multy subnet example {
  virtual_network {
    virtual_network_id = "123"
    virtual_network_name = "456"
    route_table_id = "789"
  }
}

With potentially some of the paramters being optional and the behavior would change depend on that. f.e. if route_table_id is not set, we don't create a default association in azure.

Contributing guide

Add CONTRIBUTING.MD with

  • Repository overview
  • Testing overview
  • Running multy locally
  • How to contribute (submitting PR)

Allow resource placement in availability zones

The azure subnet is not a zonal service. Resources are deployed into specific AZs unlike AWS.

Possible solutions:

  • multy handles subnet/az resolution in the backend
  • makes resources subnet agnostic

Add missing unit tests

Add unit tests for resource_metadata:

  • importing config - make sure everything is added and GetAffectedResources returns what's expected
  • exporting config
  • creating resource - make sure that resource groups are created
  • delete resource - make sure resource groups are deleted by default
  • create child resources should use the same resource group id when possible

Add unit tests for grpc:

  • make sure config is read and written
  • make sure init and apply are always called

Add unit tests for deploy:

  • make sure exec.command is called with the appropriate parameters

Check command

Validates if the config is valid without deploying anything / doing any web requests

Data source providers

Research how we want to model data providers and implement them.

Open questions:

  • How to map multiple terraform resources to a single multy resource?
  • How to handle cases where resources were not created by us, so the resource ids and other fields are not what we expect?

Handle hardcoded resource id

Allow for hardcoded ID values in place of resource references. Likely dependent on #2 because multy resource can resolve into multiple cloud resources

multy "subnet" "subnet" {
  virtual_network_id = example_vn.id
  virtual_network_id = "123"
}

cloud() function

cloud() function will allow dynamic configuration depending on which provider is being used. example below will deploy an aws ec2 instance with t2.micro and azure vm with Standard_F4s_v2

variable vm_size {
  default = cloud({
    aws   = "t2.micro"
    azure = "Standard_F4s_v2"
  })
}

multy virtual_machine vm {
  size = var.vm_size
  ...
}

Database fixes

  • Azure is not accessible publicly
  • Aws is fine with username as the username, but azure expects username@host. Maybe they are using different database engines?

More details in test/e2e/database/database_test.go

CLI Flags

Add flags to CLI
version - display cli version
check - checks if config is valid

Resource replication with count and for_each

Terraform has count and for_each to handle cases where a user wants to easily replicate resources.

We want to do something similar in multy but since there's not a 1:1 mapping between deployed resources and multy resources, we have to decide if we replicate every single resource or if we can reuse some common ones.

CLI Testing

Add CLI tests alongside go_test action

Tests:

  • files in nested directories
  • cli flags
  • bad inputs
  • install script

Region & Availability Zone mapping

Map AZ and Regions between AWS & Azure. Use lowest common value and expose them as multy variable

Region AWS Azure
UK (London) eu-west-2 UK South
Ireland eu-west-1 North Europe
France (Paris) eu-west-3 France Central
Germany (Frankfurt) eu-central-1 Germany West Central
Sweden (Stockholm) eu-north-1 Sweden Central
South Africa af-south-1 (Cape Town) South Africa North (Johannesburg)
AZ  AWS Azure
UK 3 3
Ireland 3 3
France 3 3
Germany 3 3
Sweden 3 3
South Africa 3 3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.