~jfb-tempo-consulting/unifield-wm/packaging_py27_US-3833

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
AIO Builder
-----------

This is a system for creating the Windows virtual machine
where AIOs are built. When building an AIO, the following 3
images are used:

  1. winxp.qcow2, the read-only base. It only has SSH to get remote
     access.
  2. prereq.qcow2, which captures the work done by uf-prereq. It holds
     the minimum things necessary to launch the AIO build process.
  3. the anonymous snapshot that exists while package.py starts
     the VM and builds the AIO. During the AIO build, pip is used to
     get the correct Python modules. Once the AIO is built and copied out
     of the image, package.py kills the VM and the anonymous image is
     thrown away.

Images 1 and 2 rarely change. Image 3 is created from zero in a predictable
way on every build so that we know the AIO has exactly the correct modules
in it, and so that upgrading a module is simply a matter of changing
setup.py and rebuilding the AIO.

What you might want to modify:
  * To change/upgrade modules that Unifield depends on, update setup.py
    in the unifield-server or unifield-web directory.
  * To change the Python version, edit uf-prereq and make a new prereq.qcow2
    file.
  * If you wanted to change the operating system, you'd replace winxp.qcow2
    with a new copy, and then adjust uf-prereq as necessary.

Creating a new prereq.qcow2 after editing uf-prereq
---------------------------------------------------

To make the prereq image:

  rm -f prereq.qcow2
  qemu-img create -f qcow2 -b winxp.qcow2 prereq.qcow2
  kvm -m 1G -net nic,model=rtl8139 -net user,hostfwd=tcp:127.0.0.1:10022-:22 -drive file=prereq.qcow2 -nographic
  # after it is shutdown: protect it so that it is not changed by accident
  chmod 444 prereq.qcow2

  # In another window:
  chmod 400 key
  scp -P 10022 -i key -r uf-prereq lib Naresh@localhost:
  ssh -p 10022 -i key Naresh@localhost sh uf-prereq

Editing the base image (DON'T DO IT)
------------------------------------

The base image (winxp.qcow) came from the previous AIO builder
and was manually cleaned up to not have Python on it. It does have
Cygwin, including the following:
  make, wget, rsync, openssh-server, unzip

Editing the base image should be rare or never needed. The only thing
in the base image should be enough Cygwin stuff to allow SSH in to
create the prereq image. To edit the base image:

  chmod 644 winxp.qcow2
  kvm -m 1G -net nic -net user -drive file=winxp.qcow2
  # Will pop up a window. Login with user Naresh, pass: openerp. Shutdown
  # Windows when you are done.
  chmod 444 winxp.qcow2

Installing on a new machine
---------------------------

To setup a system to run this stuff: 

  sudo -s
  apt install kvm qemu-system-common qemu-utils
  # make it so that user aio can run kvm without being root
  usermod -a -G kvm aio