Skip to content

Commit

Permalink
Merge pull request #1 from OpenCHAMI/rehome
Browse files Browse the repository at this point in the history
move to OpenCHAMI and update changelog
  • Loading branch information
alexlovelltroy authored Nov 3, 2023
2 parents 955c9fb + 5794a42 commit 44e75ae
Show file tree
Hide file tree
Showing 18 changed files with 179 additions and 91 deletions.
4 changes: 4 additions & 0 deletions .devcontainer/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=postgres
POSTGRES_HOSTNAME=localhost
13 changes: 13 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM mcr.microsoft.com/devcontainers/go:1-1.20-bullseye

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

# [Optional] Uncomment the next lines to use go get to install anything else you need
# USER vscode
# RUN go get -x <your-dependency-or-tool>
# USER root

# [Optional] Uncomment this line to install global node packages.
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go-postgres
{
"name": "Go & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
"features": {
"ghcr.io/marcozac/devcontainer-features/goreleaser:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}

}

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Configure tool-specific properties.
// "customizations": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5432],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "go version",

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
38 changes: 38 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: '3.8'

volumes:
postgres-data:

services:
app:
build:
context: .
dockerfile: Dockerfile
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- .env

volumes:
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

db:
image: postgres:latest
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
env_file:
# Ensure that the variables in .env match the same variables in devcontainer.json
- .env


# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
8 changes: 4 additions & 4 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ builds:
- amd64
dockers:
- image_templates:
- bikeshack/{{.ProjectName}}:latest
- bikeshack/{{.ProjectName}}:{{ .Tag }}
- bikeshack/{{.ProjectName}}:{{ .Major }}
- bikeshack/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}
- ghcr.io/openchami/{{.ProjectName}}:latest
- ghcr.io/openchami/{{.ProjectName}}:{{ .Tag }}
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}
- ghcr.io/openchami/{{.ProjectName}}:{{ .Major }}.{{ .Minor }}
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
Expand Down
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]


## [0.0.5] - 2023-11-02

### Added

* Ability to update firmware
* Refactored connection handling for faster scanning
* Updated to refelct home at github.com/OpenCHAMI
* Updated to reflect ghcr.io as container home

## [Unreleased]

## [0.0.1] - 2023-09-14

Expand Down
8 changes: 4 additions & 4 deletions cmd/collect.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package cmd

import (
magellan "github.com/OpenChami/magellan/internal"
"github.com/OpenChami/magellan/internal/api/smd"
"github.com/OpenChami/magellan/internal/db/sqlite"
"github.com/OpenChami/magellan/internal/log"
magellan "github.com/OpenCHAMI/magellan/internal"
"github.com/OpenCHAMI/magellan/internal/api/smd"
"github.com/OpenCHAMI/magellan/internal/db/sqlite"
"github.com/OpenCHAMI/magellan/internal/log"
"github.com/cznic/mathutil"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"github.com/OpenChami/magellan/internal/db/sqlite"
"github.com/OpenCHAMI/magellan/internal/db/sqlite"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down
16 changes: 8 additions & 8 deletions cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import (
"os"
"path"

magellan "github.com/OpenChami/magellan/internal"
"github.com/OpenChami/magellan/internal/db/sqlite"
magellan "github.com/OpenCHAMI/magellan/internal"
"github.com/OpenCHAMI/magellan/internal/db/sqlite"

"github.com/cznic/mathutil"
"github.com/spf13/cobra"
)

var (
begin uint8
end uint8
subnets []string
subnetMasks []net.IP
begin uint8
end uint8
subnets []string
subnetMasks []net.IP
disableProbing bool
)

Expand All @@ -35,10 +35,10 @@ var scanCmd = &cobra.Command{
return
}

if len(subnetMasks) < i + 1 {
if len(subnetMasks) < i+1 {
subnetMasks = append(subnetMasks, net.IP{255, 255, 255, 0})
}

hostsToScan = append(hostsToScan, magellan.GenerateHosts(subnet, &subnetMasks[i])...)
}
}
Expand Down
48 changes: 24 additions & 24 deletions cmd/update.go
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
package cmd

import (
magellan "github.com/OpenChami/magellan/internal"
"github.com/OpenChami/magellan/internal/log"
magellan "github.com/OpenCHAMI/magellan/internal"
"github.com/OpenCHAMI/magellan/internal/log"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

var (
host string
port int
firmwareUrl string
firmwareVersion string
component string
host string
port int
firmwareUrl string
firmwareVersion string
component string
transferProtocol string
status bool
status bool
)

var updateCmd = &cobra.Command{
Use: "update",
Use: "update",
Short: "Update BMC node firmware",
Run: func(cmd *cobra.Command, args []string) {
l := log.NewLogger(logrus.New(), logrus.DebugLevel)
q := &magellan.UpdateParams {
FirmwarePath: firmwareUrl,
FirmwareVersion: firmwareVersion,
Component: component,
q := &magellan.UpdateParams{
FirmwarePath: firmwareUrl,
FirmwareVersion: firmwareVersion,
Component: component,
TransferProtocol: transferProtocol,
QueryParams: magellan.QueryParams{
Drivers: []string{"redfish"},
Preferred: "redfish",
Protocol: protocol,
Host: host,
User: user,
Pass: pass,
Timeout: timeout,
Port: port,
Drivers: []string{"redfish"},
Preferred: "redfish",
Protocol: protocol,
Host: host,
User: user,
Pass: pass,
Timeout: timeout,
Port: port,
WithSecureTLS: withSecureTLS,
},
}

// check if required params are set
if host == "" || user == "" || pass == "" {
l.Log.Fatal("requires host, user, and pass to be set")
Expand All @@ -53,7 +53,7 @@ var updateCmd = &cobra.Command{
}
return
}

// client, err := magellan.NewClient(l, &q.QueryParams)
// if err != nil {
// l.Log.Errorf("could not make client: %v", err)
Expand All @@ -79,4 +79,4 @@ func init() {
updateCmd.Flags().BoolVar(&withSecureTLS, "secure-tls", false, "enable secure TLS")
updateCmd.Flags().BoolVar(&status, "status", false, "get the status of the update")
rootCmd.AddCommand(updateCmd)
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/OpenChami/magellan
module github.com/OpenCHAMI/magellan

go 1.20

Expand Down
2 changes: 1 addition & 1 deletion internal/api/dora/dora.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"github.com/OpenChami/magellan/internal/util"
"github.com/OpenCHAMI/magellan/internal/util"

"github.com/jmoiron/sqlx"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/api/smd/smd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package smd
import (
"fmt"

"github.com/OpenChami/magellan/internal/util"
"github.com/OpenCHAMI/magellan/internal/util"
// hms "github.com/alexlovelltroy/hms-smd"
)

Expand Down
Loading

0 comments on commit 44e75ae

Please sign in to comment.