forked from ryansb/sklearn-build-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch_sklearner.yml
More file actions
45 lines (41 loc) · 1.18 KB
/
launch_sklearner.yml
File metadata and controls
45 lines (41 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
- name: launch EC2 instance and build scikitlearn
hosts: localhost
connection: local
vars_files:
- ./vars.yml
tasks:
- register: ectwo
ec2:
key_name: "{{ ssh_key }}"
instance_type: t2.micro
image: ami-60b6c60a
wait: yes
instance_profile_name: "{{ profile_name }}"
user_data: "{{ lookup('file', 'sklearn_user_data.sh')}}"
# add EBS volume
volumes:
- device_name: /dev/xvda
delete_on_termination: true
volume_type: gp2
volume_size: 10
# networking biz
region: us-east-1
vpc_subnet_id: "{{ subnet_id }}"
assign_public_ip: yes
groups:
- default
- s3:
bucket: tmp.serverlesscode.com
object: "sklearn/{{ ectwo.instance_ids[0] }}-site-pkgs.zip"
dest: /tmp/sklearn-site-packages.zip
mode: get
register: result
until: result.failed is not defined or result.failed == false
retries: 15
delay: 90
- name: Terminate instances that were previously launched
ec2:
state: 'absent'
region: us-east-1
instance_ids: '{{ ectwo.instance_ids }}'