d3c21a85bb55a9e8870d8a33bf16e08b92a06af3
[ta/remote-installer.git] / work-flow.txt
1 Pre-requisite:
2
3 1. The jenkins generating rec artifacts is available and producing both the rec golden iso image and the provisioning iso image.
4
5 2. Create a new repo containing the target CD environments configurations. The configuration contains the following for each CD environment.
6
7    - user_config.yaml: The user configuration yaml file.
8
9    - admin_password: The cloudadmin user password.
10
11 3. The machine from where the remote installation is done is able to reach the BMCs and external network of the edge cloud.
12
13 Work-flow:
14
15 1. Create a new directory to be used for holding the installation artifacts.
16
17    #create the base directory
18    mkdir $BASEDIR
19
20    #images sub-directory 
21    mkdir $BASDIR/images
22
23    #certificates sub-directory
24    mkdir $BASEDIR/certificates
25
26    #user configuration and cloud admin information
27    mkdir $BASEDIR/user-configs
28
29    #installation logs directory
30    mkdir $BASEDIR/installations
31
32 2. Get REC golden image from REC jenkins artifacts and copy it to the images sub-directory under the directory created in (1).
33
34    cd $BASEDIR/images/
35    wget $URL_JENKINS_ARTIFACTS/rec.iso
36
37
38 3. Get REC booting image from REC jenkins artifacts and copy it to the images sub-directory under the directory created in (1).
39
40    cd $BASEDIR/images/
41    wget $URL_JENKINS_ARTIFACTS/boot.iso
42
43 4. Get the user-config.yaml file and admin_password file for the CD environment from the cd-environments repo and copy it to the user-configs sub-directory under the directory created in (1). Copy the files to a cloud-specific directory identiried by the cloudname.
44
45    cd $BASEDIR/user-configs/
46    mkdir $CLOUDNAME
47    cd $CLOUDNAME
48    wget $URL_CD_ENVS/$ENV/user_config.yaml 
49    wget $URL_CD_ENVS/$ENV/admin_password
50
51 5. Checkout the remote-installer repo from LF
52
53    mkdir /opt/git-repos/
54    cd /opt/git-repos/
55    git clone https://gerrit.akraino.org/r/ta/remote-installer
56
57 6. Copy the sever certificates, the client certificates in addition to CA certificate to the certificates sub-directory under the directory created in (1). 
58    The following certificates are expected to be available in the directory:
59
60    cacert.pem: The CA certificate
61    servercert.pem: The server certificate signed by the CA
62    serverkey.pem: The server key
63    clientcert.pem: The client certificate signed by the CA
64    clientkey.pem: The client key
65
66    For generating own CA, client and server certificates you can execute the following script from the remote-installer repo:
67
68    cd /opt/git-repos/remote-installer/test/certificates/
69    ./create.sh
70    cp *.pem $BASEDIR/certificates/
71
72 7. Build the remote installer docker-image.
73
74     cd /opt/git-repos/remote-installer/scripts/
75     ./build.sh
76
77 8. Start the remote installer
78
79    cd /opt/git-repos/remote-installer/scripts/
80    ./start.sh -a $API_PORT -s $HTTPS_PORT -b $BASEDIR -e $EXTERNAL_HOST_IP
81
82 9. Wait for the remote installer to become running.
83
84 10. Start the installation by sending the following http request to the installer API
85
86     POST url: https://localhost:$API_PORT/v1/installations
87     REQ body json- encoded
88     {
89         'cloud-name': $CLOUDNAME,
90         'iso': $REC_ISO_IMAGE_NAME,
91         'provisioning-iso': $REC_PROVISIONING_ISO_NAME
92     }
93     REP body json-encoded 
94     {
95         'uuid': $INSTALLATION_UUID
96     }
97
98 11. Follow the progress of the installation by sending the following http request to the installer API
99
100     GET url: https://localhost:$API_PORT/v1/installations/$INSTALLATION_UUID/state
101     REP body json-encoded 
102     {
103         'status': <ongoing|completed|failed>,
104         'description': <description>,
105         'percentage': <the progess precentage>
106     }
107
108 12. When installation is completed stop the remote installer.
109
110     cd /opt/git-repos/remote-installer/scripts/
111     ./stop.sh