Difference between revisions of "Dev/Warrior"

From Archiveteam
< Dev
Jump to navigation Jump to search
m (add devnav)
(rewrite logging into warrior)
Line 1: Line 1:
The warrior image is built off Debian 6.0.5 (squeeze). Here are the basics:
The '''[[Warrior]]''' is a virtual machine appliance used by volunteers to participate in projects.
 
== Packages ==
 
The [https://github.com/ArchiveTeam/warrior-preseed Warrior image] is built off Debian 6.0.5 (squeeze). Here are the basics:


* kernel 2.6.32-5-686 (released 2009-03-12)
* kernel 2.6.32-5-686 (released 2009-03-12)
Line 9: Line 13:


== Bootup ==
== Bootup ==
The virtual machine is self-updating. It does the following:


# Start the virtual machine
# Start the virtual machine
Line 20: Line 26:
## <code>./warrior-install.sh</code>
## <code>./warrior-install.sh</code>
### install/update seesaw, check branch, version
### install/update seesaw, check branch, version
#### installs seesaw-kit into <code>/home/warrior/warrior-code2/src</code>
### install framebuffer support, DNS caching
### install framebuffer support, DNS caching
### sets up <code>/data</code>
## <code>sudo ./make-data-disk.sh</code> (the second virtual disk)
## <code>sudo ./make-data-disk.sh</code>
### cleans up
### cleans up
### creates and prepares the partition
### it creates and prepares the data partition
### mounts the partition under <code>/data</code>
### <code>mkdir -p /home/warrior/projects</code>
### <code>mkdir -p /home/warrior/projects</code>
## <code>touch /dev/shm/ready-for-warrior</code>
## <code>touch /dev/shm/ready-for-warrior</code>
Line 36: Line 43:
The code for each project is stored in <code>/home/warrior/projects/<PROJECTNAME>/</code>
The code for each project is stored in <code>/home/warrior/projects/<PROJECTNAME>/</code>


== Testing pre-production code ==
== Logging into the Warrior ==
 
To log into the warrior,
 
# Press Alt+F3 (or press Alt+Right).
# The username is <code>root</code> and the password is <code>archiveteam</code>
# You are now logged in as root.
# To log in as <code>warrior</code>, enter: <code>sudo -u warrior -i</code>
 
== Testing Core Warrior Code ==
 
Since the Warrior pulls from GitHub, it is important to commit only stable changes into the <code>master</code> branch. Recommended Git branching practices use a development branch.
 
To test core Warrior code, you can switch from the <code>master</code> branch to the <code>development</code> branch. The Warrior will fetch the corresponding seesaw-kit repository branch.


(Don't do this unless you really need or want to.) If you are developing a warrior script, you can test it by switching your warrior from the <code>master</code> branch to the <code>development</code> branch or create another branch. The warrior will fetch the corresponding seesaw repo branch.
To change branches,


<ol>
# Log in as root
<li>Start the warrior.</li>
# Execute <code>cd /home/warrior/warrior-code2</code>
<li>Press Alt+F3 and log in as <code>root</code> , password <code>archiveteam</code></li>
# Execute <code>sudo -u warrior git checkout development</code>
<li><code>cd /home/warrior/warrior-code2</code></li>
# Execute <code>reboot</code>
<li><code>sudo -u warrior git checkout development</code></li>
<li><code>reboot</code></li>
</ol>


By the same route you can return your warrior to the <code>master</code> branch.
By the same route you can return your warrior to the <code>master</code> branch.


{{devnav}}
{{devnav}}

Revision as of 11:56, 5 December 2013

The Warrior is a virtual machine appliance used by volunteers to participate in projects.

Packages

The Warrior image is built off Debian 6.0.5 (squeeze). Here are the basics:

  • kernel 2.6.32-5-686 (released 2009-03-12)
  • Python 2.6.6, pip 1.1
  • Perl v5.10.1, cpan 1.9402 (still needs config)
  • gcc 4.4.5, make 3.81, bash 4.1.5
  • nano 2.2.4 with color syntax highlighting
  • curl 7.21.0

Bootup

The virtual machine is self-updating. It does the following:

  1. Start the virtual machine
  2. Linux boots
  3. The user warrior is automatically logged in.
  4. /etc/inittab kicks off /home/warrior/warrior-code2/boot.sh.
    1. This will git pull https://github.com/ArchiveTeam/warrior-code2 into /home/warrior/warrior-code2/.
    2. /home/warrior/warrior-code2/warrior-runner.sh sets up a process which monitors /dev/shm/ready-for-warrior and launches run-warrior when the state changes.
  5. boot.sh launches /home/warrior/warrior-code/boot-part-2.sh
  6. boot-part-2.sh is a short script that does the following:
    1. ./warrior-install.sh
      1. install/update seesaw, check branch, version
        1. installs seesaw-kit into /home/warrior/warrior-code2/src
      2. install framebuffer support, DNS caching
    2. sudo ./make-data-disk.sh (the second virtual disk)
      1. cleans up
      2. it creates and prepares the data partition
      3. mounts the partition under /data
      4. mkdir -p /home/warrior/projects
    3. touch /dev/shm/ready-for-warrior
      1. triggers the launch of /usr/local/bin/run-warrior which launches /home/warrior/warrior-code2/src/seesaw/run-warrior
      2. contacts warriorhq.archiveteam.org and requests the projects.json file. This file contains the projects you see in the Available Projects page.
    4. ./say-hello.sh
      1. setup vmware port forwarding
      2. show splash screen
  7. Point your web browser to http://localhost:8001 and go.

The code for each project is stored in /home/warrior/projects/<PROJECTNAME>/

Logging into the Warrior

To log into the warrior,

  1. Press Alt+F3 (or press Alt+Right).
  2. The username is root and the password is archiveteam
  3. You are now logged in as root.
  4. To log in as warrior, enter: sudo -u warrior -i

Testing Core Warrior Code

Since the Warrior pulls from GitHub, it is important to commit only stable changes into the master branch. Recommended Git branching practices use a development branch.

To test core Warrior code, you can switch from the master branch to the development branch. The Warrior will fetch the corresponding seesaw-kit repository branch.

To change branches,

  1. Log in as root
  2. Execute cd /home/warrior/warrior-code2
  3. Execute sudo -u warrior git checkout development
  4. Execute reboot

By the same route you can return your warrior to the master branch.


Developer Documentation