{
	"user": "warcforceone",
	"name": "megawarc-factory",
	"namespace": "warcforceone",
	"repository_type": "image",
	"status": 1,
	"description": "",
	"is_private": false,
	"is_automated": false,
	"can_edit": false,
	"star_count": 0,
	"pull_count": 80,
	"last_updated": "2020-12-29T13:44:29.663201Z",
	"is_migrated": false,
	"collaborator_count": 0,
	"affiliation": null,
	"hub_user": "warcforceone",
	"has_starred": false,
	"full_description": "Archive Team megawarc factory\n=============================\nSome scripts to bundle Archive Team uploads and upload them to Archive.org. Use at your own risk; the scripts will need per-project adjustment.\n\nThese scripts make batches of uploaded warc.gz files, combine them into megawarcs and upload them to their permanent home on Archive.org.\n\nThree processes work together to make this happen:\n\n1. The chunker\n--------------\nThe chunker moves uploaded warc.gz files from the upload directory to a batch directory. When this directory has grown to 50GB, the chunker begins a new directory and moves the completed directory to the packing queue.\n\nThere can only be one chunker per upload directory. Chunking doesn't take long, if the files are not moving to a different filesystem.\n\n2. The packer\n-------------\nThe packer monitors the packing queue. When the chunker brings a new directory, the packer removes the directory from the queue and starts converting it into a megawarc (using the megawarc utility). When that is done, the packer moves the megawarc to the upload queue and removes the original warc files.\n\nIf necessary, multiple packers can work the same queue. Packing involves lots of gzipping and takes some time.\n\n3. The uploader\n---------------\nThe uploader monitors the upload queue. When the packer brings a new megawarc, the uploader removes the megawarc from the queue and uploads it to Archive.org. If the upload is successful, the uploader removes the megawarc.\n\nIf necessary, multiple uploaders can work the same queue.\n\n4. The offloader\n---------------\nThe offloader monitors the upload queue. Instead of uploading to Archive.org, the megawarc will be sent to another host via rsync. This is useful when Archive.org has issues. \n\nThis can be used at the same time as the uploader without issues.\n\n\nFilesystems\n-----------\nFrom the chunker to the uploader, the chunks move through the system as timestamped directories, e.g., 20130401213900.) This timestamp will also be used in the name of the uploaded item on Archive.org. The queues are directories. Processes 'claim' a chunk by moving it from the queue directory to their working directory. This assumes that `mv` is an atomic operation.\n\nFor efficiency and to maintain the atomicity of `mv`, the filesystem of the directories is very important:\n\n1. The Rsync upload directory, the chunker working directory, the packing queue and that side of the packer's working directory should all be on the same filesystem. This ensures that the uploaded warc.gz files never move to a different file system.\n2. The megawarc side of the packer's working directory, the upload queue and the uploader's working directory should also share a filesystem.\n\nFilesystems 1 and 2 do not have to be the same.\n\n\nConfiguration\n-------------\nCreate a configuration file called `config.sh` and place it in the directory where you start the scripts. See the `config.example.sh` for more details.\n\n\nRunning\n-------\nRun the scripts in `screen`, `tmux` or something similar. `touch RUN` before you start the scripts. Use `rm RUN` to stop gracefully.\n\n* `./chunk-multiple` (run exactly one)\n* `./pack-multiple` (you may run more than one)\n* `./upload-multiple` (you may run more than one)\n* `./offload-multiple` (you may run more than one, can work in tandem with `upload-multiple`)\n\nUtility scripts:\n\n* `./du-all` will run `du -hs` in all queues\n\n\nScheduling priorities\n---------------------\nThe packing script will use all your I/O capacity. Consider using `nice` and `ionice` to run in at a lower priority, so it doesn't hinder your incoming Rsync or outgoing curl uploads.\n\n* `ionice -c 2 -n 6 nice -n 19 ./pack-multiple`\n\n\nRecovering from errors\n----------------------\nThe scripts are designed not to lose data. If a script dies, you can look in its working directory for in-progress items and move them back to the queue.\n\n\nRequirements\n------------\nThese scripts use Bash and Curl.\n\nYou should clone https://github.com/ArchiveTeam/megawarc to the `megawarc/` subdirectory of these scripts. The megawarc utility requires Python and Gzip.\n\n",
	"permissions": {
		"read": true,
		"write": false,
		"admin": false
	}
}