From 859302774c4d719cf949f419d0efcfd8cbad6ca2 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 27 May 2019 21:35:53 +0100 Subject: Add a new AWS backend using Amazon Machine Images The existing AWS backend uses system containers backed on to the AWS hosted NFS service (EFS). This has some advantages, but also some disadvantages. Using the EFS service allows building a container on one instance, with the state being held on the EFS, and then launching a new instance to run the container. Using EFS also provides persistence, at least beyond individual EC2 instances. However, build performance when using EFS is poor compared with a local store without the overhead of the network latency. Additionally, the startup speed of the container running off EFS is slow compared to local storage. This backend doesn't use EFS, instead the Guix store sits on instance storage. Rather than using a system container for a Mini Environment, an Amazon Machine Image (AMI) is built instead. The fast local storage makes builds faster, and using EBS storage for the Mini Envirnoments as well as not having the overhead of starting Ubuntu, then starting the container also makes startup faster. --- .../20190519091614_terraform_aws_using_ami.rb | 17 +++++++ db/structure.sql | 57 +++++++++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20190519091614_terraform_aws_using_ami.rb (limited to 'db') diff --git a/db/migrate/20190519091614_terraform_aws_using_ami.rb b/db/migrate/20190519091614_terraform_aws_using_ami.rb new file mode 100644 index 0000000..0375a2a --- /dev/null +++ b/db/migrate/20190519091614_terraform_aws_using_ami.rb @@ -0,0 +1,17 @@ +class TerraformAwsUsingAmi < ActiveRecord::Migration[5.2] + def change + create_table :terraform_aws_using_ami_backends do |t| + t.string :label + t.string :aws_region + t.string :aws_access_key_id + t.string :aws_secret_access_key + t.string :domain + t.string :route_53_zone_id, null: false + t.string :vpc_id, null: false + t.string :ssh_public_key + t.string :ssh_private_key + + t.timestamps + end + end +end diff --git a/db/structure.sql b/db/structure.sql index 5e5aaba..7fd8ca2 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -458,6 +458,45 @@ CREATE SEQUENCE public.terraform_aws_backends_id_seq ALTER SEQUENCE public.terraform_aws_backends_id_seq OWNED BY public.terraform_aws_backends.id; +-- +-- Name: terraform_aws_using_ami_backends; Type: TABLE; Schema: public; Owner: - +-- + +CREATE TABLE public.terraform_aws_using_ami_backends ( + id bigint NOT NULL, + label character varying, + aws_region character varying, + aws_access_key_id character varying, + aws_secret_access_key character varying, + domain character varying, + route_53_zone_id character varying NOT NULL, + vpc_id character varying NOT NULL, + ssh_public_key character varying, + ssh_private_key character varying, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + + +-- +-- Name: terraform_aws_using_ami_backends_id_seq; Type: SEQUENCE; Schema: public; Owner: - +-- + +CREATE SEQUENCE public.terraform_aws_using_ami_backends_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + + +-- +-- Name: terraform_aws_using_ami_backends_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: - +-- + +ALTER SEQUENCE public.terraform_aws_using_ami_backends_id_seq OWNED BY public.terraform_aws_using_ami_backends.id; + + -- -- Name: terraform_libvirt_backends; Type: TABLE; Schema: public; Owner: - -- @@ -594,6 +633,13 @@ ALTER TABLE ONLY public.que_jobs ALTER COLUMN id SET DEFAULT nextval('public.que ALTER TABLE ONLY public.terraform_aws_backends ALTER COLUMN id SET DEFAULT nextval('public.terraform_aws_backends_id_seq'::regclass); +-- +-- Name: terraform_aws_using_ami_backends id; Type: DEFAULT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.terraform_aws_using_ami_backends ALTER COLUMN id SET DEFAULT nextval('public.terraform_aws_using_ami_backends_id_seq'::regclass); + + -- -- Name: terraform_libvirt_backends id; Type: DEFAULT; Schema: public; Owner: - -- @@ -695,6 +741,14 @@ ALTER TABLE ONLY public.terraform_aws_backends ADD CONSTRAINT terraform_aws_backends_pkey PRIMARY KEY (id); +-- +-- Name: terraform_aws_using_ami_backends terraform_aws_using_ami_backends_pkey; Type: CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.terraform_aws_using_ami_backends + ADD CONSTRAINT terraform_aws_using_ami_backends_pkey PRIMARY KEY (id); + + -- -- Name: terraform_libvirt_backends terraform_libvirt_backends_pkey; Type: CONSTRAINT; Schema: public; Owner: - -- @@ -879,6 +933,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('20180621065525'), ('20180621220505'), ('20180623083735'), -('20190106112141'); +('20190106112141'), +('20190519091614'); -- cgit v1.2.3