Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 111-cli-expansion-stateful-behaviour-more-command-feedback
  • 120-integration-tests-fail
  • 138-making-gnmi-response-processing-more-error-tolerable
  • 140-refactor-pipelines
  • 156-a-setrequest-to-change-a-specific-path-of-an-ond-only-works-for-paths-with-string-values
  • 186-creating-a-device-based-on-plugin-or-csbi-is-not-possible
  • 195-requesting-changes-does-not-work-in-storemode-database
  • 223-database-pnd-store-is-missing-option-to-search-by-name
  • 225-adding-support-and-visualization-for-the-test-coverage2
  • 233-structs-like-loadeddevice-loadedsbi-loadedrole-loadeduser-are-never-passed-as-pointer
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules-govet
  • 246-implement-our-own-version-to-send-gnmi-requests
  • 258-deal-with-read-only-fields-in-yang
  • 282-refactoring-of-the-current-test-setup
  • 289-quantum-safe-communication-between-rabbitmq-and-sdn-controller
  • 291-lab-vm-for-arm64-apple
  • 296-related-existing-work-about-change-logic-for-yang-models
  • 320-deadline-and-cancellation-for-grpc-calls
  • 336-add-error-handling-for-mne-watching-if-the-provided-paths-do-not-exist
  • 349-integration-test-for-lab01
  • 350-applying-a-sdn-configuration-should-also-update-the-internal-configuration-of-managed-network
  • 351-link-shadowing-of-global-variables
  • 383-re-organize-comands-in-cli
  • 392-remove-renovate
  • PSD_VGU_Logging
  • add-backup-script
  • add-dockerignore
  • add-script-with-docker-stats
  • add-sr-linux-yang-models
  • add-support-for-mtls-in-plugins
  • allow-slashes-in-branch-names
  • arm-build
  • bump-ygot-generator-to-0-0-5
  • check-unit-tests
  • ci-refactor-1337
  • cli-docs
  • create-health-check-api
  • custom-marshal-for-grpc-gateway
  • deployment-docker-compose
  • develop
  • docker-build-cache-experiments
  • fbi1478-master-patch-42436
  • fix-docker-registry-error
  • fix-linting-in-makefile
  • fix-viper
  • go-plugin-playground
  • gosdn-storage-cleanup
  • heiss_bachelor_thesis
  • hotfix-unique-list-error-from-a-device-get-request
  • integration-test-pipeline-fix
  • inventory-manager-netbox
  • istaester/add-git-hooks
  • istaester/architecture-figures
  • istaester/basic-persistance-layer
  • istaester/bump-ygot-version
  • istaester/cli-tests
  • istaester/db
  • istaester/handle-makefile-in-editorconfig
  • istaester/init-monorepo
  • istaester/plugin-registry
  • istaester/provide-pnd-service
  • istaester/tooling
  • istaester/update-readme
  • master
  • mb/plugin-registry
  • mk/benchmark-stores
  • mpsd-at-vgu
  • neil/cobra-tests
  • new-integration-test-setup-v1
  • profile
  • proto-getters
  • recursive-read-only-try-1337
  • registry-used-by-app
  • remove-stuff
  • renovate/babel-runtime-7.x-lockfile
  • renovate/buf.build-gen-go-bufbuild-protovalidate-protocolbuffers-go-1.x
  • renovate/dompurify-3.x-lockfile
  • renovate/eslint-9.x-lockfile
  • renovate/eslint-plugin-prettier-5.x-lockfile
  • renovate/eslint-plugin-react-7.x-lockfile
  • renovate/eslint-plugin-react-hooks-5.x-lockfile
  • renovate/eslint-plugin-react-refresh-0.x-lockfile
  • renovate/fortawesome-fontawesome-svg-core-6.x-lockfile
  • renovate/fortawesome-free-regular-svg-icons-6.x-lockfile
  • renovate/fortawesome-free-solid-svg-icons-6.x-lockfile
  • renovate/github.com-aristanetworks-goarista-digest
  • renovate/github.com-bufbuild-protovalidate-go-0.x
  • renovate/github.com-docker-docker-27.x
  • renovate/github.com-docker-docker-28.x
  • renovate/github.com-grpc-ecosystem-grpc-gateway-v2-2.x
  • renovate/github.com-hashicorp-go-plugin-1.x
  • renovate/github.com-lesismal-nbio-1.x
  • renovate/github.com-openconfig-gnmi-0.x
  • renovate/github.com-prometheus-client_golang-1.x
  • renovate/go.mongodb.org-mongo-driver-2.x
  • renovate/golangci-golangci-lint-1.x
  • renovate/google.golang.org-genproto-googleapis-api-digest
  • renovate/react-18.x-lockfile
  • renovate/react-bootstrap-2.x-lockfile
  • 0.1.0
101 results

Target

Select target project
  • danet/gosdn
1 result
Select Git revision
  • 111-cli-expansion-stateful-behaviour-more-command-feedback
  • 120-integration-tests-fail
  • 138-making-gnmi-response-processing-more-error-tolerable
  • 140-refactor-pipelines
  • 156-a-setrequest-to-change-a-specific-path-of-an-ond-only-works-for-paths-with-string-values
  • 186-creating-a-device-based-on-plugin-or-csbi-is-not-possible
  • 195-requesting-changes-does-not-work-in-storemode-database
  • 223-database-pnd-store-is-missing-option-to-search-by-name
  • 225-adding-support-and-visualization-for-the-test-coverage2
  • 233-structs-like-loadeddevice-loadedsbi-loadedrole-loadeduser-are-never-passed-as-pointer
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules
  • 242-improve-security-by-enabling-and-enforcing-more-linting-rules-govet
  • 246-implement-our-own-version-to-send-gnmi-requests
  • 258-deal-with-read-only-fields-in-yang
  • 282-refactoring-of-the-current-test-setup
  • 289-quantum-safe-communication-between-rabbitmq-and-sdn-controller
  • 291-lab-vm-for-arm64-apple
  • 296-related-existing-work-about-change-logic-for-yang-models
  • 320-deadline-and-cancellation-for-grpc-calls
  • 336-add-error-handling-for-mne-watching-if-the-provided-paths-do-not-exist
  • 349-integration-test-for-lab01
  • 350-applying-a-sdn-configuration-should-also-update-the-internal-configuration-of-managed-network
  • 351-link-shadowing-of-global-variables
  • 383-re-organize-comands-in-cli
  • 392-remove-renovate
  • PSD_VGU_Logging
  • add-backup-script
  • add-dockerignore
  • add-script-with-docker-stats
  • add-sr-linux-yang-models
  • add-support-for-mtls-in-plugins
  • allow-slashes-in-branch-names
  • arm-build
  • bump-ygot-generator-to-0-0-5
  • check-unit-tests
  • ci-refactor-1337
  • cli-docs
  • create-health-check-api
  • custom-marshal-for-grpc-gateway
  • deployment-docker-compose
  • develop
  • docker-build-cache-experiments
  • fbi1478-master-patch-42436
  • fix-docker-registry-error
  • fix-linting-in-makefile
  • fix-viper
  • go-plugin-playground
  • gosdn-storage-cleanup
  • heiss_bachelor_thesis
  • hotfix-unique-list-error-from-a-device-get-request
  • integration-test-pipeline-fix
  • inventory-manager-netbox
  • istaester/add-git-hooks
  • istaester/architecture-figures
  • istaester/basic-persistance-layer
  • istaester/bump-ygot-version
  • istaester/cli-tests
  • istaester/db
  • istaester/handle-makefile-in-editorconfig
  • istaester/init-monorepo
  • istaester/plugin-registry
  • istaester/provide-pnd-service
  • istaester/tooling
  • istaester/update-readme
  • master
  • mb/plugin-registry
  • mk/benchmark-stores
  • mpsd-at-vgu
  • neil/cobra-tests
  • new-integration-test-setup-v1
  • profile
  • proto-getters
  • recursive-read-only-try-1337
  • registry-used-by-app
  • remove-stuff
  • renovate/babel-runtime-7.x-lockfile
  • renovate/buf.build-gen-go-bufbuild-protovalidate-protocolbuffers-go-1.x
  • renovate/dompurify-3.x-lockfile
  • renovate/eslint-9.x-lockfile
  • renovate/eslint-plugin-prettier-5.x-lockfile
  • renovate/eslint-plugin-react-7.x-lockfile
  • renovate/eslint-plugin-react-hooks-5.x-lockfile
  • renovate/eslint-plugin-react-refresh-0.x-lockfile
  • renovate/fortawesome-fontawesome-svg-core-6.x-lockfile
  • renovate/fortawesome-free-regular-svg-icons-6.x-lockfile
  • renovate/fortawesome-free-solid-svg-icons-6.x-lockfile
  • renovate/github.com-aristanetworks-goarista-digest
  • renovate/github.com-bufbuild-protovalidate-go-0.x
  • renovate/github.com-docker-docker-27.x
  • renovate/github.com-docker-docker-28.x
  • renovate/github.com-grpc-ecosystem-grpc-gateway-v2-2.x
  • renovate/github.com-hashicorp-go-plugin-1.x
  • renovate/github.com-lesismal-nbio-1.x
  • renovate/github.com-openconfig-gnmi-0.x
  • renovate/github.com-prometheus-client_golang-1.x
  • renovate/go.mongodb.org-mongo-driver-2.x
  • renovate/golangci-golangci-lint-1.x
  • renovate/google.golang.org-genproto-googleapis-api-digest
  • renovate/react-18.x-lockfile
  • renovate/react-bootstrap-2.x-lockfile
  • 0.1.0
101 results
Show changes
Commits on Source (4)
Showing with 79584 additions and 78665 deletions
......@@ -58,3 +58,6 @@ applications/venv-manager/*.clab.yaml
#debug
__debug_bin
#misc
*/mongo_backup_*.tar
......@@ -19,6 +19,7 @@ to get all submodules.
- [Contributing](CONTRIBUTING.md)
- [License](LICENSE)
- [CI Status](#ci-status)
- [Development Tutorial](#development-tutorial)
# Overview
......@@ -122,3 +123,20 @@ Information about how to use the CLI is provided in the `cli` folder, see [here]
| ------ | ------ |
| [![coverage report](https://code.fbi.h-da.de/danet/gosdn/badges/master/coverage.svg)](https://code.fbi.h-da.de/danet/gosdn/-/commits/master) | [![coverage report](https://code.fbi.h-da.de/danet/gosdn/badges/develop/coverage.svg)](https://code.fbi.h-da.de/danet/gosdn/-/commits/develop) |
| [![pipeline status](https://code.fbi.h-da.de/danet/gosdn/badges/master/pipeline.svg)](https://code.fbi.h-da.de/danet/gosdn/-/commits/master) | [![pipeline status](https://code.fbi.h-da.de/danet/gosdn/badges/develop/pipeline.svg)](https://code.fbi.h-da.de/danet/gosdn/-/commits/develop) |
# Development Tutorial
TBD
## Backup and restore your mongodb
If you are using the mongodb provided via the `docker-compose.yaml`, you can easily backup and restore your data via two scripts.
```bash
./scripts/backup_mongo_volume.sh $(suffix_of_backup)
```
```bash
./scripts/restore_mongo_volume.sh $(suffix_of_backup)
```
Keep in mind that a restore will restart the mongodb container.
......@@ -4,6 +4,7 @@ import (
"flag"
"fmt"
"os"
"strings"
venvmanager "code.fbi.h-da.de/danet/gosdn/applications/venv-manager/venv-manager"
"google.golang.org/grpc"
......@@ -25,11 +26,13 @@ func main() {
fmt.Printf("Usable flags of the venv-manager:\n\n")
fmt.Println("--controller string\n\t Controller URL and Port. (Default: 'localhost:55055')")
fmt.Println("--file string\n\t Filename of the resulting topology file. (Default: 'venv.clab.yaml')")
fmt.Println("--registry string\n\t URL of the container registry to use. Keep in mind that cEOS images are not available on dockerhub. (Default: dockerhub)")
fmt.Println("--registry string\n\t URL of the container registry to use. Keep in mind that cEOS images and prebuild linux images with the gnmi target are not available on dockerhub. (Default: dockerhub)")
fmt.Println("--help\n\t Shows this help screen.")
}
flag.Parse()
customContainerRegistryURL = ensureLastCharIsSlash(customContainerRegistryURL)
fmt.Println("I will try to connect to goSDN located at", dialConnectionURL)
venvManager := venvmanager.NewVenvManager(dialConnectionURL, dialOption, yamlFilepath, customContainerRegistryURL)
......@@ -50,3 +53,16 @@ func main() {
}
os.Exit(0)
}
// Ensures that the last char of a string is a slash, if this string is not empty.
func ensureLastCharIsSlash(inputString string) string {
if len(inputString) == 0 {
return inputString
}
if strings.HasSuffix(inputString, "/") {
return inputString
}
return inputString + "/"
}
......@@ -23,12 +23,33 @@ func (n Node) GetID() string {
// FillAllFields fills all remaining fields of object with data from YangData.
func (n *Node) FillAllFields(containerRegistryURL string) {
// make switch case here to differentialte between linux, arista, etc
// Works if linux and our gnmi target is used.
softwareVersion := n.YangData.System.State.SoftwareVersion
if softwareVersion != nil {
// Checks if software version is in compatible format.
result, _ := regexp.MatchString(`^([A-Za-z0-9\.\/])*:([A-Za-z0-9\.])*`, *softwareVersion)
if result {
n.Kind = "linux"
n.Image = containerRegistryURL + *softwareVersion
return
}
// specific to arista
n.Kind = "couldn't detect kind"
n.Image = "couldn't detect image"
return
}
// Specific to arista
regex := regexp.MustCompile(`[0-9]+\.[0-9]+\.[0-9][A-Z]`)
dockerTag := string(regex.FindAll([]byte(*n.YangData.Lldp.Config.SystemDescription), 1)[0])
// If it's not linux with our gnmi target and not arista, we don't support it.
if len(dockerTag) == 0 {
n.Kind = "couldn't detect kind"
n.Image = "couldn't detect image"
return
}
n.Kind = "ceos"
n.Image = containerRegistryURL + n.Kind + ":" + dockerTag
}
......@@ -194,7 +194,7 @@ func (v *VenvManager) loadNetworkElementModelPathsIntoGosdn(ctx context.Context,
pndService := pndPb.NewPndServiceClient(conn)
for _, node := range *nodes {
_, err := pndService.GetPath(ctx, &pndPb.GetPathRequest{Mneid: node.ID, Pid: v.pnd, Path: "lldp"})
_, err := pndService.GetPath(ctx, &pndPb.GetPathRequest{Mneid: node.ID, Pid: v.pnd, Path: "/"})
if err != nil {
return err
}
......@@ -215,7 +215,7 @@ func (v *VenvManager) getAndAddMoreData(topologyData *topology.GoSdnTopology) (*
// Create 'root' path to be able to load the whole model from the store.
path, err := ygot.StringToPath("/", ygot.StructuredPath)
if err != nil {
panic(err)
return nil, err
}
// just to load model data into goSDN to have newest data available for get request
......
......@@ -271,8 +271,8 @@ func Test_pndImplementation_MarshalNetworkElement(t *testing.T) {
}{
{
name: "default",
want: "{\n\t\"Acl\": null,\n\t\"Bfd\": null,\n\t\"Components\": null,\n\t\"Interfaces\": null,\n\t\"Keychains\": null,\n\t\"Lldp\": null,\n\t\"Messages\": null,\n\t\"NetworkInstances\": null,\n\t\"RoutingPolicy\": null,\n\t\"System\": null\n}",
args: args{mneid},
want: "{\n\t\"Acl\": null,\n\t\"Bfd\": null,\n\t\"Components\": null,\n\t\"Interfaces\": null,\n\t\"Keychains\": null,\n\t\"Lldp\": null,\n\t\"LocalRoutes\": null,\n\t\"Messages\": null,\n\t\"NetworkInstances\": null,\n\t\"RoutingPolicy\": null,\n\t\"System\": null\n}",
wantErr: false,
},
}
......
......@@ -114,4 +114,3 @@ topology:
- endpoints: ["ceos0:eth1","ceos1a:eth1"]
- endpoints: ["ceos0:eth2","centos1:eth1"]
- endpoints: ["ceos1a:eth2","centos2:eth1"]
Subproject commit 2fa291d6bdb4b281d4e1b3dfa3254ffa7257d800
Subproject commit 5c289956f96fb2e4b1969c0da0bf21884c40a6eb
Subproject commit 6f1bbc3467842761ee29d282ee850489ca4bc4b5
Subproject commit f546d90c604cd95c3112484d905ac243985318ab
This diff is collapsed.
This diff is collapsed.
Subproject commit e3fa98e0d27cf7fecf75c71d31316f45c83ddfd6
Subproject commit 103538c4a2766cd210e123b84f562be14d54ea68
#!/bin/sh
file_suffix=$1
docker-compose pause mongo
docker run --rm --volumes-from gosdn-mongo-1 -v $(pwd)/docker_volume_backup:/backup ubuntu bash -c 'cd /data/db/ && tar cvf /backup/mongo_backup_'"$file_suffix"'.tar .'
docker-compose unpause mongo
#!/bin/sh
file_suffix=$1
docker-compose pause mongo
docker run --rm --volumes-from gosdn-mongo-1 -v $(pwd)/docker_volume_backup:/backup ubuntu bash -c 'rm -r /data/db/* && cd /data/db && tar xvf /backup/mongo_backup_'"$file_suffix"'.tar --strip 1'
docker-compose restart mongo
if [ $# -eq 0 ]
then
echo 'you need to provide the password for the admin user'
exit 1
fi
./artifacts/gosdnc login --controller 127.0.0.1:55055 --u admin --p $1
./artifacts/gosdnc pnd use 5f20f34b-cbd0-4511-9ddc-c50cf6a3b49d
./artifacts/gosdnc device create -a 172.100.0.11:6030 -u admin -p admin --name="ceos0"
./artifacts/gosdnc device create -a 172.100.0.12:6030 -u admin -p admin --name="ceos1a"
./artifacts/gosdnc device create -a 172.100.0.3:7030 -u admin -p admin --name="ubuntu1"
./artifacts/gosdnc device list