summaryrefslogtreecommitdiffstats
path: root/src/tools/models/buildtool/README
blob: a790044624cc546131053d4aeca282731a378782 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
CONTENTS OF THIS FILE
---------------------
   
 * Introduction
 * Requirements
 * Recommended modules
 * Installation
 * Configuration
 * Troubleshooting
 * Maintainers


INTRODUCTION
------------

  This Model tool is designed to take the user supplied inputs such as Model name, commit ID, path where the image to be build and compilation mode
  and build the corresponding model SBE image of EKB and verify the image if needed using CI build script methods.

  By default Model name MUST be supplied to the tool as an argument, while rest arguments are optional.

  The tool is designed to take hit due to build break. The build work flow is split into three separate workflow.
  Thus checkpoints are maintained to re-start for last known good checkpoint of the build run.

  First part intializing and setting up the sandboxes, Repo and other logs.

  Second part validating the PPE models.

  Third part does the compiling and triggering CI. In case the build break due to ERRORS, a build ACTION file is generated.
  This build Action file is used to continue skipping the first part of intialization and directly starts building it with patches if needed.


  -------------------------------------------------------------------------------------------------------------
  :: Command line USAGE options for building FW SBE image ::

  buildSBEImage.py  -m <model_name> -c < Commit log id> -i <abc,xyz> -p < PPE build path> -b <Auto|Manual|Force>


   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   | NOTE: Please use VALID input string since validation in code is a tideous task. |
   |       By default user MUST pass a VALID Model ID.                               |
   +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

  ***** Options Supported  *****
          -m,--model        = Target Model to be used to build the image
          -c,--commit       = Base commit id of the patch to be checkout
          -i,--cherry-pick  = refs id of the patch to be cherry pick
          -p,--path         = Path where user wants the image to be built
          -b,--build        = Default is Auto, user can pass Manual/Force
                              Auto   : CI build and test
                              Manual : Only compiles No Simics run
                              Force  : Rebuild Repo
          -e,--env          = User ENV build exports

  ***** Allowed options example  *****
   [ Only Model as an input ]
   buildSBEImage.py -m n10_e9027_tp026_soa_sc_u285_01


   [ Model and PPE commit id as an input ]
   buildSBEImage.py -m n10_e9027_tp026_soa_sc_u285_01 -c c1980f5a4de0bac8922260ed827fe37a124b2b0a


   [ Model and PPE commit id and cherry pick refs as an input ]
   [ ** Coma ',' separated cherry pick patch refs **]
   buildSBEImage.py -m n10_e9027_tp026_soa_sc_u285_01 -c c1980f5a4de0bac8922260ed827fe37a124b2b0a -i refs/changes/57/21157/3, refs/changes/35/22535/2


   [ Model, PPE commit id and PPE image build path as an input ]
   buildSBEImage.py -m n10_e9027_tp026_soa_sc_u285_01 -c c1980f5a4de0bac8922260ed827fe37a124b2b0a -p <user path>


   [ Choosing to compile ONLY option - By Default it run in Auto mode and trigger CI build and simics run test ]
   buildSBEImage.py -m n10_e9027_tp026_soa_sc_u285_01 -b Manual


   [ Choosing to do fresh Force build ]
   buildSBEImage.py -m n10_e9027_tp026_soa_sc_u285_01 -b Force

   [ Facility to -ONLY- Build PPE with ENV passed and run simcis without EKB models ]
   buildSBEImage.py -m <model> -c b85fe14bd0c86ff223ac15e261ead4877949084c -i refs/changes/57/21157/3,refs/changes/35/22535/2 -e '__FAPI_DELAY_SIM__=1'
  -------------------------------------------------------------------------------------------------------------


  [ Model Tool work flow layout ]
  ------------------------------

  **************************************************************************************************************
  [START][ Main module ]   <Model Name>   < base Commit >   <Patches>            <Build Path>                <Build Mode>
              |                 |                |              |                     |                          |
              |                 |                |              |                     |                          |
        buildSBEImage.py -m  XXXXXXXX  -c   YYYYYYYYYYY   -i refs/xxx,refs/yyy   -p /home/somelocation/   -b    Manual/Auto/Force
              |
              |
        [ Pre-req's & Cleanup stale data ] <- ** -> [ Applies by-pass action if pending from previous build failure run]
              |                                                                                   |
              |                                                                                   |
        [ Create Working Sandbox/Repo for EKB/PPE ]   <---- uses Library utility                  |
              |                                                                                   |
              \                                                                         [ Skips & Jumps ahead ]
               \                                                                                  |
              sbeGitUtility.py   <-- uses sbeConstants.py for constants paths & codes             |
                  |                                                                               |
                  |                                                                               | 
              [ PPE specific Model check, patches cherry pick ]  <-- ppeModel.py                  | 
                  |                                                                               |
                  |                                                                               |
                  |                                                                               /
                  |                                                                              /
              [ Setup hooks to EKB env.bash ]  <-- sbeContinue.py      <------------------------/
                  |
                  |
              [ Loads the ENV and workon EKB ]
                  |
                  \
                  Triggers [ sbeContinue.py ]  <-- Uses Library utility
                       |
                       |
                   [ Loads sbeGitUtility.py ] <-- To validate Models and comits
                       |
                       |
                   [ Model EKB checkout ] 
                           |
                           |
                   [ Stage files for Compilation ]  <-- Copy EKB to PPE
                           |
                           |
                     -------------
                     |           |
                     |           |
                [ Manual ]     [ CI build ]
                    |                |
                    |                |
            [ 'make all' ]       [ loads ./src/test/framework/build-script ]
                    |                |
                    |                |
                    ------------------
                           |
                           |
                     [ Returns the control to sbeContinue.py ]
                           |
                           |
                     [ Returns the control to buildSBEImage.py ]
                           |
                           |
                        [ Tool Exits ]
                           |
                           |
                        [ END ]

  **************************************************************************************************************
                                                               

REQUIREMENTS
------------

  This need python version 2.6 or above to work.
  The user is assumed to have access tokens and Gerrit setup in the configuration for EKB and PPE and Sandbox.


RECOMMENDED MODULES
-------------------

  This uses in background the EKB mirroring tool and compilers from scl devtoolset to switch between the git Repo during compilation.

INSTALLATION
------------

  This has no installable needed by the tool. Checkout the code from production repo for latest updates.


CONFIGURATION
-------------

  Permission access location directory to where the image needs to be build.
  
  Access tokens needed before launching this tool. 
  Example if you type 'tokens', at minimal, it must have these AFS Austin and AWD tokens

  Tokens held by the Cache Manager:

  User's (AFS ID 69515) tokens for afs@rchland.ibm.com [Expires Dec  8 23:32]
  User's (AFS ID 21061) tokens for afs@awd.austin.ibm.com [Expires Dec  8 23:32]
  User's (AFS ID 21060) tokens for afs@austin.ibm.com [Expires Dec  8 23:32]
   --End of list--

  Configuration in SSH must be setup for gerrit access. Example
  By default : "gerrit-server" is needed

  $ cat ~/.ssh/config
  Host hw.gerrit
        Hostname gfw160.aus.stglabs.ibm.com
        Port 29418
        AFSTokenPassing no
  Host gerrit-server
        Hostname gfw160.aus.stglabs.ibm.com
        Port 29418
        AFSTokenPassing no
  Host fsp.gerrit
        Hostname fspbld06.in.ibm.com
        Port 29418
        AFSTokenPassing no
  Host hostboot.gerrit
        Hostname gfw160.aus.stglabs.ibm.com
        Port 29418
        AFSTokenPassing no


  !! NOTE : Host hw.gerrit order has to be first in config in case you are using this tool, since the EKB model env needs its that way. !!
  To confirm ./workon ekb
  echo $GERRIT_SRV
  hw.gerrit
  $


TROUBLESHOOTING
---------------

  It is observed during a CI build which in turns starts the NIMBUS simics sometimes failed to start if simic is ran for the first time.

  It is advised to start the simics manaually once and acccept the WindRiver license prompted on the simics console. Post that re-run the 
  tool and it will allow your simics to be started by the script onwards.

  The error codes are uniquely encoded and displayed when failed. Refer the RC code for identifying the issues.

  At glance these are the RC code setup up and subject to changes and update.

  '''
   Generic RC code
  '''
  SUCCESS_EXIT   = 0
  SHELL_EXIT     = 1
  HELP_EXIT      = 10
  NEW_MODEL_EXIT = 11
  NO_PENDING_MODEL_EXIT = 12
  VALIDATE_EXIT  = 13
  FILES_EXIST    = 14
  DIR_EMPTY      = 15

  BYPASS_EXIT  = 20
  PATCH_IGNORE_EXIT = 21
  PPE_MODEL_NOT_EXIST = 22
  PPE_MODEL_SKIP_EXIT = 23

  EKB_MODEL_NOT_EXIST = 40

  ERROR_SYS_ERROR_EXIT = 100

  ERROR_PREP_GIT_FAILED         = 1000
  ERROR_PREP_TOKEN_SETUP_FAILED = 1001
  ERROR_PREP_GIT_SETUP_FAILED   = 1002

  ERROR_PREP_COM_FAILED     = 2000
  ERROR_PREP_CHANGE_FAILED  = 2001
  ERROR_GIT_CHANGEID_FAILED = 2002

  ERROR_LOAD_ENV = 5000
  ERROR_MODEL_NOT_EXIST = 256  # hacked RC code exit from bash

  # Build failures Manual or CI
  BUILD_CI_FAILED      = 10000
  BUILD_MANUAL_FAILED  = 10001

  Note : The user exception handling are not done as a part of this changes. For future enhancement.

  Important log files : Check under base ~/GIT_REPO_SB/logs/

  -----------------
  buildActionHooks : 
  -----------------
  By default this file will be written for the build script to re-start skipping initialization.
  This file is persistent if there is a failure else it will get cleared.

  ----------------------------------
  buildPPE_out_20151202-123355.log : 
  ----------------------------------
  This is has the date and time run of the build and good for debugging during failure.
  This file is persistent until next run.

  ----------------------
  PATCH_ACTION_TEMPLATE:
  ----------------------
  This files is generated on build or CI failure. Add extra step needed in the build step.
  This is intended to be persistent per model or until cleared manaully.


MAINTAINERS
-----------

Original Tool Designer/Developer:
  * George Keishing (Hostboot) - http://faces.tap.ibm.com/bluepages/profile.html?email=gkeishin@in.ibm.com

Current maintainers:
  * Sachin Gupta ( SBE ) - http://faces.tap.ibm.com/bluepages/profile.html?email=sgupta2m@in.ibm.com
  * Sunil Kumar  ( SBE ) - http://faces.tap.ibm.com/bluepages/profile.html?email=skumar8j@in.ibm.com
OpenPOWER on IntegriCloud