Skip to content

Commit

Permalink
document more CI feature TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
nektro committed Aug 20, 2022
1 parent 5116ff9 commit d274d95
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/job_doer.zig
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub fn start(allocator: std.mem.Allocator, job: *db.Job, run_tracker: *std.Threa

// start qemu-system docker container, get id
const image = getImageName(job.arch.tag);
// TODO make zig version part of image name, dont hardcode this path
const env = try std.fmt.allocPrint(alloc, "image=/images/{s}/{s}/stage4.qcow2", .{ @tagName(job.arch.tag), @tagName(job.os.tag) });
const bind = try std.fmt.allocPrint(alloc, "{s}:/images:ro", .{host_images_path});
const id = blk: {
Expand Down
4 changes: 4 additions & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ pub fn main() !void {
var arena = std.heap.ArenaAllocator.init(alloc);
defer arena.deinit();
try runner.pullImages(arena.allocator());
// TODO ensure these semaphores are being used properly
// TODO ensure the nektro/docker-qemu-system docker images are pulled
// TODO implement the /jobs/:job web endpoint
// TODO only publish version when all jobs have passed
for (try db.Job.byKeyAll(arena.allocator(), .state, .queued, .asc)) |_| runner.sem_pickup.post();
for (range(try std.fmt.parseInt(u32, flag.getSingle("ci-max-jobs") orelse "10", 10))) |_| runner.sem_runner.post();

Expand Down
9 changes: 9 additions & 0 deletions tools/gen_stage2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,19 @@ sudo qemu-nbd --connect=/dev/nbd0 $after
sudo fdisk /dev/nbd0 -l

case "$os" in
# TODO auto pick the the biggest drive for target device
debian)
# Device Boot Start End Sectors Size Id Type
# /dev/nbd0p1 * 2048 132216831 132214784 63G 83 Linux
# /dev/nbd0p2 132218878 134215679 1996802 975M 5 Extended
# /dev/nbd0p5 132218880 134215679 1996800 975M 82 Linux swap / Solaris
sudo mount --rw /dev/nbd0p1 $(pwd)/mnt/
;;
alpine)
# Device Boot Start End Sectors Size Id Type
# /dev/nbd0p1 * 2048 206847 204800 100M 83 Linux
# /dev/nbd0p2 206848 8357887 8151040 3.9G 82 Linux swap / Solaris
# /dev/nbd0p3 8357888 134217727 125859840 60G 83 Linux
sudo mount --rw /dev/nbd0p3 $(pwd)/mnt/
;;
esac
Expand Down

0 comments on commit d274d95

Please sign in to comment.