Difference between revisions of "Dev/Warrior"

From Archiveteam
< Dev
Jump to navigation Jump to search
m (Reverted edits by Megalanya1 (talk) to last revision by Start)
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:
== Packages ==
== Packages ==


The [https://github.com/ArchiveTeam/warrior-preseed Warrior image] is built off Debian 6.0.5 (squeeze). Here are the basics:
The [https://github.com/ArchiveTeam/Ubuntu-Warrior Warrior image] is built off Alpine Linux 3.6.2:


* kernel 2.6.32-5-686 (released 2009-03-12)
* kernel 4.9.32
* Python 2.6.6, pip 1.1
* the virtual machine image is prepared using the <code>[https://github.com/ArchiveTeam/Ubuntu-Warrior/blob/master/stage.sh stage.sh]</code> script and contains a pre-installed <code>[https://raw.githubusercontent.com/ArchiveTeam/Ubuntu-Warrior/master/boot.sh /root/boot.sh]</code> script that downloads and boots the warrior.
* Perl v5.10.1, cpan 1.9402 (still needs config)
 
* gcc 4.4.5, make 3.81, bash 4.1.5
The warrior itself runs in a [https://store.docker.com/community/images/archiveteam/warrior-dockerfile docker container] running Ubuntu 16.04 that contains
* nano 2.2.4 with color syntax highlighting
 
* curl 7.21.0
* Python 3.5.2, pip 8.1.1
* Perl v5.22.1
* gcc 5.4.0, make 4.1, bash 4.3.48
* curl 7.47.0


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


== Logging into the Warrior ==
== Logging into the Warrior ==
Line 50: Line 32:
# The username is <code>root</code> and the password is <code>archiveteam</code>
# The username is <code>root</code> and the password is <code>archiveteam</code>
# You are now logged in as root.
# You are now logged in as root.
# To log in as <code>warrior</code>, enter: <code>sudo -u warrior -i</code>
# Check the docker container with <code>docker ps</code>. This will give you docker container identifier, among others.
# Enter the inside of the docker container with <code>docker exec -it ''identifier'' /bin/bash</code>


== Testing Core Warrior Code ==
== Testing Core Warrior Code ==
Line 66: Line 49:


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.
The code for each project is stored in <code>/home/warrior/projects/<PROJECTNAME>/</code>


{{devnav}}
{{devnav}}

Revision as of 20:52, 30 June 2018

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

Packages

The Warrior image is built off Alpine Linux 3.6.2:

  • kernel 4.9.32
  • the virtual machine image is prepared using the stage.sh script and contains a pre-installed /root/boot.sh script that downloads and boots the warrior.

The warrior itself runs in a docker container running Ubuntu 16.04 that contains

  • Python 3.5.2, pip 8.1.1
  • Perl v5.22.1
  • gcc 5.4.0, make 4.1, bash 4.3.48
  • curl 7.47.0

Bootup

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

  1. Start the virtual machine
  2. Linux boots
  3. boot.sh downloads and launches /root/startup.sh
  4. startup.sh prepares and runs a docker container with the warrior runner
  5. Point your web browser to http://localhost:8001 and go.

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. Check the docker container with docker ps. This will give you docker container identifier, among others.
  5. Enter the inside of the docker container with docker exec -it identifier /bin/bash

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.

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


Developer Documentation