Skip to content

Commit 9087fee

Browse files
committed
Remove build settings from packs.
1 parent 4a6d62f commit 9087fee

File tree

5 files changed

+1
-167
lines changed

5 files changed

+1
-167
lines changed

app/Http/Controllers/Admin/PackController.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,6 @@ public function export(Request $request, $id, $files = false)
183183
'description' => $pack->dscription,
184184
'selectable' => (bool) $pack->selectable,
185185
'visible' => (bool) $pack->visible,
186-
'build' => [
187-
'memory' => $pack->build_memory,
188-
'swap' => $pack->build_swap,
189-
'cpu' => $pack->build_cpu,
190-
'io' => $pack->build_io,
191-
'container' => $pack->build_container,
192-
'script' => $pack->build_script,
193-
],
194186
];
195187

196188
$filename = tempnam(sys_get_temp_dir(), 'pterodactyl_');

app/Repositories/ServiceRepository/Pack.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ public function create(array $data)
4949
'option' => 'required|exists:service_options,id',
5050
'selectable' => 'sometimes|boolean',
5151
'visible' => 'sometimes|boolean',
52-
'build_memory' => 'required|integer|min:0',
53-
'build_swap' => 'required|integer|min:0',
54-
'build_cpu' => 'required|integer|min:0',
55-
'build_io' => 'required|integer|min:10|max:1000',
56-
'build_container' => 'required|string',
57-
'build_script' => 'sometimes|nullable|string',
5852
]);
5953

6054
if ($validator->fails()) {
@@ -77,12 +71,6 @@ public function create(array $data)
7771
$pack = Models\ServicePack::create([
7872
'option' => $data['option'],
7973
'uuid' => $uuid->generate('servers', 'uuid'),
80-
'build_memory' => $data['build_memory'],
81-
'build_swap' => $data['build_swap'],
82-
'build_cpu' => $data['build_swap'],
83-
'build_io' => $data['build_io'],
84-
'build_script' => (empty($data['build_script'])) ? null : $data['build_script'],
85-
'build_container' => $data['build_container'],
8674
'name' => $data['name'],
8775
'version' => $data['version'],
8876
'description' => (empty($data['description'])) ? null : $data['description'],
@@ -142,12 +130,6 @@ public function createWithTemplate(array $data)
142130
'option' => $data['option'],
143131
'selectable' => $json->selectable,
144132
'visible' => $json->visible,
145-
'build_memory' => $json->build->memory,
146-
'build_swap' => $json->build->swap,
147-
'build_cpu' => $json->build->cpu,
148-
'build_io' => $json->build->io,
149-
'build_container' => $json->build->container,
150-
'build_script' => $json->build->script,
151133
]);
152134

153135
$pack = Models\ServicePack::findOrFail($id);
@@ -169,12 +151,6 @@ public function createWithTemplate(array $data)
169151
'option' => $data['option'],
170152
'selectable' => $json->selectable,
171153
'visible' => $json->visible,
172-
'build_memory' => $json->build->memory,
173-
'build_swap' => $json->build->swap,
174-
'build_cpu' => $json->build->cpu,
175-
'build_io' => $json->build->io,
176-
'build_container' => $json->build->container,
177-
'build_script' => $json->build->script,
178154
]);
179155
}
180156
}
@@ -188,12 +164,6 @@ public function update($id, array $data)
188164
'option' => 'required|exists:service_options,id',
189165
'selectable' => 'sometimes|boolean',
190166
'visible' => 'sometimes|boolean',
191-
'build_memory' => 'required|integer|min:0',
192-
'build_swap' => 'required|integer|min:0',
193-
'build_cpu' => 'required|integer|min:0',
194-
'build_io' => 'required|integer|min:10|max:1000',
195-
'build_container' => 'required|string',
196-
'build_script' => 'sometimes|string',
197167
]);
198168

199169
if ($validator->fails()) {
@@ -203,12 +173,6 @@ public function update($id, array $data)
203173
DB::transaction(function () use ($id, $data) {
204174
Models\ServicePack::findOrFail($id)->update([
205175
'option' => $data['option'],
206-
'build_memory' => $data['build_memory'],
207-
'build_swap' => $data['build_swap'],
208-
'build_cpu' => $data['build_swap'],
209-
'build_io' => $data['build_io'],
210-
'build_script' => (empty($data['build_script'])) ? null : $data['build_script'],
211-
'build_container' => $data['build_container'],
212176
'name' => $data['name'],
213177
'version' => $data['version'],
214178
'description' => (empty($data['description'])) ? null : $data['description'],

database/migrations/2016_11_11_220649_add_pack_support.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ public function up()
1717
$table->increments('id');
1818
$table->unsignedInteger('option');
1919
$table->char('uuid', 36)->unique();
20-
$table->unsignedInteger('build_memory')->nullable();
21-
$table->unsignedInteger('build_swap')->nullable();
22-
$table->unsignedInteger('build_cpu')->nullable();
23-
$table->unsignedInteger('build_io')->nullable();
24-
$table->text('build_script')->nullable();
25-
$table->string('build_container')->default('alpine:latest');
2620
$table->string('name');
2721
$table->string('version');
2822
$table->text('description')->nullable();

resources/views/admin/services/packs/edit.blade.php

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -88,72 +88,14 @@
8888
</div>
8989
</div>
9090
<hr />
91-
<div class="row">
92-
<div class="col-md-12">
93-
<h5 class="nopad">Build Parameters</h5>
94-
<div class="well" style="margin-bottom:0">
95-
<div class="row">
96-
<div class="form-group col-md-3 col-xs-6">
97-
<label class="control-label">Memory:</label>
98-
<div class="input-group">
99-
<input type="text" name="build_memory" class="form-control" value="{{ old('build_memory', $pack->build_memory) }}"/>
100-
<span class="input-group-addon">MB</span>
101-
</div>
102-
</div>
103-
<div class="form-group col-md-3 col-xs-6">
104-
<label class="control-label">Swap:</label>
105-
<div class="input-group">
106-
<input type="text" name="build_swap" class="form-control" value="{{ old('build_swap', $pack->build_swap) }}"/>
107-
<span class="input-group-addon">MB</span>
108-
</div>
109-
</div>
110-
<div class="form-group col-md-3 col-xs-6">
111-
<label class="control-label">CPU:</label>
112-
<div class="input-group">
113-
<input type="text" name="build_cpu" class="form-control" value="{{ old('build_cpu', $pack->build_cpu) }}"/>
114-
<span class="input-group-addon">%</span>
115-
</div>
116-
</div>
117-
<div class="form-group col-md-3 col-xs-6">
118-
<label class="control-label">IO:</label>
119-
<div class="input-group">
120-
<input type="text" name="build_io" class="form-control" value="{{ old('build_io', $pack->build_io) }}"/>
121-
<span class="input-group-addon">I/O</span>
122-
</div>
123-
</div>
124-
<div class="form-group col-md-12">
125-
<div>
126-
<p class="text-muted"><small>If you would like to set limits on the build container you may do so above. Setting <code>memory</code>, <code>swap</code>, or <code>cpu</code> to <code>0</code> will allow unlimited resource utilization. IO must be in a range between <code>10</code> to <code>1000</code> and is a relative weighting to other container IO usage.</small></p>
127-
</div>
128-
</div>
129-
</div>
130-
<div class="row">
131-
<div class="form-group col-md-12">
132-
<label class="control-label">Build Container:</label>
133-
<div>
134-
<input type="text" name="build_container" class="form-control" value="{{ old('build_container', $pack->build_container) }}"/>
135-
<p class="text-muted"><small>Provide the docker container image that will be used to build this service pack. This container is <em>only</em> used if a build script is provided below.</small></p>
136-
</div>
137-
</div>
138-
<div class="form-group col-md-12">
139-
<label class="control-label">Build Script:</label>
140-
<div id="build_script" style="height:200px">{{ $pack->build_script }}</div>
141-
<textarea id="editor_contents" name="build_script" class="hidden"></textarea>
142-
<p class="text-muted"><small>This script will be run inside the container if provided. You should use this script to download any additional dependencies or compile packages as necessary on the node. Your uploaded archive (if provided), will be available in <code>/input</code> as <code>archive.tar.gz</code> or as <code>archive.zip</code> depending on what format you uploaded as. Your completed pack should be saved as <code>package.tar.gz</code> in the <code>/output</code> directory (e.g. <code>/output/package.tar.gz</code>).</small></p>
143-
</div>
144-
</div>
145-
</div>
146-
</div>
147-
</div>
148-
<hr />
14991
<div class="row">
15092
<div class="col-md-12">
15193
<h5 class="nopad">Package Archive</h5>
15294
<div class="well" style="margin-bottom:0">
15395
<div class="row">
15496
<div class="form-group col-md-12">
15597
@if(count($files) > 1)
156-
<div class="alert alert-danger"><strong>Warning!</strong> Service packs should only contain a single pack archive in either <code>.zip</code> or <code>.tar.gz</code> format. We've detected more than one file for this pack.</div>
98+
<div class="alert alert-danger"><strong>Warning!</strong> Service packs should only contain a single pack archive in <code>.tar.gz</code> format. We've detected more than one file for this pack.</div>
15799
@endif
158100
<table class="table table-striped">
159101
<thead>

resources/views/admin/services/packs/new.blade.php

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -85,64 +85,6 @@
8585
</div>
8686
</div>
8787
<hr />
88-
<div class="row">
89-
<div class="col-md-12">
90-
<h5 class="nopad">Build Parameters</h5>
91-
<div class="well" style="margin-bottom:0">
92-
<div class="row">
93-
<div class="form-group col-md-3 col-xs-6">
94-
<label class="control-label">Memory:</label>
95-
<div class="input-group">
96-
<input type="text" name="build_memory" class="form-control" value="{{ old('build_memory', 0) }}"/>
97-
<span class="input-group-addon">MB</span>
98-
</div>
99-
</div>
100-
<div class="form-group col-md-3 col-xs-6">
101-
<label class="control-label">Swap:</label>
102-
<div class="input-group">
103-
<input type="text" name="build_swap" class="form-control" value="{{ old('build_swap', 0) }}"/>
104-
<span class="input-group-addon">MB</span>
105-
</div>
106-
</div>
107-
<div class="form-group col-md-3 col-xs-6">
108-
<label class="control-label">CPU:</label>
109-
<div class="input-group">
110-
<input type="text" name="build_cpu" class="form-control" value="{{ old('build_cpu', 0) }}"/>
111-
<span class="input-group-addon">%</span>
112-
</div>
113-
</div>
114-
<div class="form-group col-md-3 col-xs-6">
115-
<label class="control-label">IO:</label>
116-
<div class="input-group">
117-
<input type="text" name="build_io" class="form-control" value="{{ old('build_io', 300) }}"/>
118-
<span class="input-group-addon">I/O</span>
119-
</div>
120-
</div>
121-
<div class="form-group col-md-12">
122-
<div>
123-
<p class="text-muted"><small>If you would like to set limits on the build container you may do so above. Setting <code>memory</code>, <code>swap</code>, or <code>cpu</code> to <code>0</code> will allow unlimited resource utilization. IO must be in a range between <code>10</code> to <code>1000</code> and is a relative weighting to other container IO usage.</small></p>
124-
</div>
125-
</div>
126-
</div>
127-
<div class="row">
128-
<div class="form-group col-md-12">
129-
<label class="control-label">Build Container:</label>
130-
<div>
131-
<input type="text" name="build_container" class="form-control" value="{{ old('build_container', 'alpine:latest') }}"/>
132-
<p class="text-muted"><small>Provide the docker container image that will be used to build this service pack. This container is <em>only</em> used if a build script is provided below.</small></p>
133-
</div>
134-
</div>
135-
<div class="form-group col-md-12">
136-
<label class="control-label">Build Script:</label>
137-
<div id="build_script" style="height:200px"></div>
138-
<textarea id="editor_contents" name="build_script" class="hidden"></textarea>
139-
<p class="text-muted"><small>This script will be run inside the container if provided. You should use this script to download any additional dependencies or compile packages as necessary on the node. Your uploaded archive (if provided), will be available in <code>/input</code> as <code>archive.tar.gz</code> or as <code>archive.zip</code> depending on what format you uploaded as. Your completed pack should be saved as <code>package.tar.gz</code> in the <code>/output</code> directory (e.g. <code>/output/package.tar.gz</code>).</small></p>
140-
</div>
141-
</div>
142-
</div>
143-
</div>
144-
</div>
145-
<hr />
14688
<div class="row">
14789
<div class="col-md-12">
14890
<h5 class="nopad">File Upload</h5>

0 commit comments

Comments
 (0)