-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Matt Richerson <[email protected]>
- Loading branch information
1 parent
91601a9
commit 06658ac
Showing
102 changed files
with
11,450 additions
and
1,636 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: RPM Build | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
repo_version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version_output: ${{ steps.step1.outputs.version }} | ||
steps: | ||
- name: Verify context | ||
run: | | ||
echo "ref is ${{ github.ref }}" | ||
echo "ref_type is ${{ github.ref_type }}" | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Get Version | ||
id: step1 | ||
run: echo "version=$(./git-version-gen)" >> $GITHUB_OUTPUT | ||
|
||
rpm_build: | ||
runs-on: ubuntu-latest | ||
needs: repo_version | ||
container: | ||
image: centos:8 | ||
env: | ||
NODE_ENV: development | ||
ports: | ||
- 80 | ||
options: --cpus 1 | ||
steps: | ||
- name: "Build context" | ||
env: | ||
VERSION_OUTPUT: ${{ needs.repo_version.outputs.version_output }} | ||
run: | | ||
echo "ref is ${{ github.ref }}" | ||
echo "ref_type is ${{ github.ref_type }}" | ||
echo "head.sha is ${{ github.event.pull_request.head.sha }}" | ||
echo "git-version-gen is $VERSION_OUTPUT" | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: environment setup | ||
env: | ||
VERSION_OUTPUT: ${{ needs.repo_version.outputs.version_output }} | ||
run: | | ||
dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos | ||
dnf -y distro-sync | ||
dnf -y makecache --refresh | ||
dnf install -y rpm-build rpmdevtools git make | ||
dnf module -y install go-toolset | ||
rpmdev-setuptree | ||
echo $VERSION_OUTPUT > .rpmversion | ||
cat .rpmversion | ||
tar -czf /github/home/rpmbuild/SOURCES/nnf-clientmount-1.0.tar.gz --transform 's,^,nnf-clientmount-1.0/,' . | ||
- name: build rpms | ||
run: rpmbuild -ba clientmount.spec | ||
- name: upload rpms | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nnf-clientmount-1.0-1.el8.x86_64.rpm | ||
path: /github/home/rpmbuild/RPMS/x86_64/nnf-clientmount-1.0-1.el8.x86_64.rpm | ||
- name: upload srpms | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nnf-clientmount-1.0-1.el8.src.rpm | ||
path: /github/home/rpmbuild/SRPMS/nnf-clientmount-1.0-1.el8.src.rpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* | ||
* Copyright 2021-2023 Hewlett Packard Enterprise Development LP | ||
* Other additional copyright holders may be indicated within. | ||
* | ||
* The entirety of this work is 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. | ||
*/ | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
dwsv1alpha2 "github.com/DataWorkflowServices/dws/api/v1alpha2" | ||
"github.com/DataWorkflowServices/dws/utils/updater" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
"sigs.k8s.io/controller-runtime/pkg/client" | ||
) | ||
|
||
type NnfNodeBlockStorageAllocationSpec struct { | ||
// Aggregate capacity of the block devices for each allocation | ||
Capacity int64 `json:"capacity,omitempty"` | ||
|
||
// List of nodes where /dev devices should be created | ||
Access []string `json:"access,omitempty"` | ||
} | ||
|
||
// NnfNodeBlockStorageSpec defines the desired storage attributes on a NNF Node. | ||
// Storage spec are created on bequest of the user and fullfilled by the NNF Node Controller. | ||
type NnfNodeBlockStorageSpec struct { | ||
// Allocations is the list of storage allocation to make | ||
Allocations []NnfNodeBlockStorageAllocationSpec `json:"allocations,omitempty"` | ||
} | ||
|
||
type NnfNodeBlockStorageStatus struct { | ||
// Allocations is the list of storage allocations that were made | ||
Allocations []NnfNodeBlockStorageAllocationStatus `json:"allocations,omitempty"` | ||
|
||
dwsv1alpha2.ResourceError `json:",inline"` | ||
|
||
Ready bool `json:"ready"` | ||
} | ||
|
||
type NnfNodeBlockStorageDeviceStatus struct { | ||
// NQN of the base NVMe device | ||
NQN string `json:"NQN"` | ||
|
||
// Id of the Namespace on the NVMe device (e.g., "2") | ||
NamespaceId string `json:"namespaceId"` | ||
|
||
// Total capacity allocated for the storage. This may differ from the requested storage | ||
// capacity as the system may round up to the requested capacity satisify underlying | ||
// storage requirements (i.e. block size / stripe size). | ||
CapacityAllocated int64 `json:"capacityAllocated,omitempty"` | ||
} | ||
|
||
type NnfNodeBlockStorageAccessStatus struct { | ||
// /dev paths for each of the block devices | ||
DevicePaths []string `json:"devicePaths,omitempty"` | ||
|
||
// Redfish ID for the storage group | ||
StorageGroupId string `json:"storageGroupId,omitempty"` | ||
} | ||
|
||
type NnfNodeBlockStorageAllocationStatus struct { | ||
Accesses map[string]NnfNodeBlockStorageAccessStatus `json:"accesses,omitempty"` | ||
|
||
// List of NVMe namespaces used by this allocation | ||
Devices []NnfNodeBlockStorageDeviceStatus `json:"devices,omitempty"` | ||
|
||
// Total capacity allocated for the storage. This may differ from the requested storage | ||
// capacity as the system may round up to the requested capacity satisify underlying | ||
// storage requirements (i.e. block size / stripe size). | ||
CapacityAllocated int64 `json:"capacityAllocated,omitempty"` | ||
|
||
// Redfish ID for the storage pool | ||
StoragePoolId string `json:"storagePoolId,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.ready" | ||
// +kubebuilder:printcolumn:name="ERROR",type="string",JSONPath=".status.error.severity" | ||
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" | ||
type NnfNodeBlockStorage struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec NnfNodeBlockStorageSpec `json:"spec,omitempty"` | ||
Status NnfNodeBlockStorageStatus `json:"status,omitempty"` | ||
} | ||
|
||
func (ns *NnfNodeBlockStorage) GetStatus() updater.Status[*NnfNodeBlockStorageStatus] { | ||
return &ns.Status | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// NnfNodeBlockStorageList contains a list of NNF Nodes | ||
type NnfNodeBlockStorageList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []NnfNodeBlockStorage `json:"items"` | ||
} | ||
|
||
func (n *NnfNodeBlockStorageList) GetObjectList() []client.Object { | ||
objectList := []client.Object{} | ||
|
||
for i := range n.Items { | ||
objectList = append(objectList, &n.Items[i]) | ||
} | ||
|
||
return objectList | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&NnfNodeBlockStorage{}, &NnfNodeBlockStorageList{}) | ||
} |
Oops, something went wrong.