Documentation
¶
Overview ¶
Copyright 2025 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Copyright 2025 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Copyright 2025 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Copyright 2025 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Copyright 2025 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Copyright 2025 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Copyright 2025 Cloudbase Solutions SRL
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
Index ¶
- type Controller
- type Worker
- func (w *Worker) GetScaleSet() params.ScaleSet
- func (w *Worker) GetScaleSetClient() (*scalesets.ScaleSetClient, error)
- func (w *Worker) HandleJobsAvailable(jobs []params.ScaleSetJobMessage) error
- func (w *Worker) HandleJobsCompleted(jobs []params.ScaleSetJobMessage) (err error)
- func (w *Worker) HandleJobsStarted(jobs []params.ScaleSetJobMessage) (err error)
- func (w *Worker) Owner() string
- func (w *Worker) SetDesiredRunnerCount(count int) error
- func (w *Worker) SetLastMessageID(id int64) error
- func (w *Worker) Start() (err error)
- func (w *Worker) Stop() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
ScaleSets map[uint]*scaleSet
Entity params.ForgeEntity
// contains filtered or unexported fields
}
Controller is responsible for managing scale sets for one github entity.
func NewController ¶
func (*Controller) ConsolidateRunnerState ¶
func (c *Controller) ConsolidateRunnerState(byScaleSetID map[int][]params.RunnerReference) error
ConsolidateRunnerState will send a list of existing github runners to each scale set worker. The scale set worker will then need to cross check the existing runners in Github with the sate in the database. Any inconsistencies will b reconciliated. This cleans up any manually removed runners in either github or the providers.
func (*Controller) Start ¶
func (c *Controller) Start() (err error)
func (*Controller) Stop ¶
func (c *Controller) Stop() error
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) GetScaleSet ¶
func (*Worker) GetScaleSetClient ¶
func (w *Worker) GetScaleSetClient() (*scalesets.ScaleSetClient, error)
func (*Worker) HandleJobsAvailable ¶
func (w *Worker) HandleJobsAvailable(jobs []params.ScaleSetJobMessage) error
func (*Worker) HandleJobsCompleted ¶
func (w *Worker) HandleJobsCompleted(jobs []params.ScaleSetJobMessage) (err error)
HandleJobCompleted handles a job completed message. If a job had a runner assigned and was not canceled before it had a chance to run, then we mark that runner as pending_delete.
func (*Worker) HandleJobsStarted ¶
func (w *Worker) HandleJobsStarted(jobs []params.ScaleSetJobMessage) (err error)
HandleJobStarted updates the runners from idle to active in the DB and assigns the job to them.