Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync source model #34

Merged
merged 6 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
# Apply this job if it is a PR and by OWNER with '/approve' comment
if: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/approve') }}

# This job runs on Ubuntu-latest (Ubuntu 20.04 LTS checked on 2022-09-06)
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# Check the commenter is a member of the maintainer team of this repo
- name: Extract Repository Name
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/continuous-delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:

if: github.repository == 'cloud-barista/cm-beetle'

# This job runs on Ubuntu-latest (Ubuntu 20.04 LTS checked on 2022-09-06)
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- name: Checkout source code
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ jobs:
# The job key (i.e., ID) is "build-source-code"
build-source-code:
# Job name is "Building source code"
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
name: Build source code
strategy:
matrix:
go-version: ["1.19", "1.20", "1.21"]
os: [ubuntu-20.04]
go-version: ["1.21"]
os: [ubuntu-22.04]
#os: [ubuntu-22.04, ubuntu-20.04, windows-2022, windows-2019]
runs-on: ${{matrix.os}}
steps:
Expand All @@ -48,9 +50,9 @@ jobs:
# Job name is "Build a container image"
name: Build a container image

# This job runs on Ubuntu-latest (Ubuntu 20.04 LTS checked on 2022-09-06)
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/make-swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
update-swagger-doc:
name: Update Swagger doc
if: github.repository == 'cloud-barista/cm-beetle'
# This job runs on Ubuntu-latest (Ubuntu 20.04 LTS checked on 2022-09-06)
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
go-version: [ '1.19' ]
go-version: [ '1.21' ]

steps:
- name: Set up Go ${{ matrix.go-version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prow-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
execute:
# Execute when author_association of the comment is OWNER or MEMBER
if: ${{ github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' }}
# This job runs on Ubuntu-latest (Ubuntu 20.04 LTS checked on 2022-09-06)
# This job runs on Ubuntu-latest (Ubuntu 22.04 LTS checked on 2023-12-13)
# See https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Execute action according to commands
steps:
# Check author_association
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Stage 1 - Go Build
##############################################################

FROM golang:1.19-alpine AS builder
FROM golang:1.21-alpine AS builder

#RUN apk update && apk add --no-cache bash

Expand All @@ -16,13 +16,14 @@ ADD . /go/src/github.com/cloud-barista/cm-beetle

WORKDIR /go/src/github.com/cloud-barista/cm-beetle/cmd/cm-beetle

RUN go build -ldflags '-w -extldflags "-static"' -tags cm-beetle -o cm-beetle -v
# NOTE - "make prod" executes the commannd, "CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags '-s -w' -o cm-beetle"
RUN make prod

#############################################################
## Stage 2 - Application Setup
##############################################################

FROM ubuntu:latest as prod
FROM ubuntu:22.04 as prod

# use bash
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
default:
cd cmd/cm-beetle && $(MAKE)

cc:
cd cmd/cm-beetle && $(MAKE)

run:
cd cmd/cm-beetle && $(MAKE) run

runwithport:
cd cmd/cm-beetle && $(MAKE) runwithport --port=$(PORT)

clean:
cd cmd/cm-beetle && $(MAKE) clean

prod:
cd cmd/cm-beetle && $(MAKE) prod

source-model:
cd pkg/api/rest/model && $(MAKE) source-model

swag swagger:
cd pkg/ && $(MAKE) swag
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Computing Infrastructure Migration framework (codename: cm-beetle) is going to s
- Operating system (OS):
- Ubuntu 22.04
- Languages:
- Go: 1.19
- Go: 1.21
- Python: 3.8.10
- Container runtime:
- Docker: 20.10.12
Expand Down
57 changes: 20 additions & 37 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
module github.com/cloud-barista/cm-beetle

go 1.19
go 1.21

toolchain go1.21.4

require (
github.com/cloud-barista/cb-store v0.7.1
github.com/cloud-barista/cm-honeybee v0.0.0-20231212101859-53110c631d7f
github.com/docker/docker v24.0.7+incompatible
github.com/fsnotify/fsnotify v1.6.0
github.com/go-playground/validator/v10 v10.16.0
github.com/go-resty/resty/v2 v2.10.0
github.com/labstack/echo/v4 v4.11.2
github.com/labstack/echo/v4 v4.11.3
github.com/libvirt/libvirt-go-xml v7.4.0+incompatible
github.com/mattn/go-sqlite3 v1.14.17
github.com/rs/xid v1.5.0
github.com/rs/zerolog v1.31.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.16.0
github.com/swaggo/echo-swagger v1.4.0
github.com/swaggo/swag v1.16.1
gopkg.in/natefinch/lumberjack.v2 v2.2.1
gopkg.in/yaml.v2 v2.4.0
xorm.io/xorm v1.3.4
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/bramvdbogaerde/go-scp v1.2.1 // indirect
github.com/bwmarrin/snowflake v0.3.0 // indirect
github.com/cloud-barista/cb-larva v0.0.16 // indirect
github.com/cloud-barista/cb-log v0.7.0 // indirect
github.com/cloud-barista/cb-tumblebug/src v0.0.0-20230724172618-8f225d0127e8 // indirect
github.com/coreos/go-semver v0.3.1 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/NeowayLabs/drm v0.0.0-20190824133025-4939fc0ad345 // indirect
github.com/docker/go-connections v0.4.1-0.20231110212414-fa09c952e3ea // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
Expand All @@ -38,12 +41,12 @@ require (
github.com/goccy/go-json v0.10.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jollaman999/utils v1.0.10 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/labstack/gommon v0.4.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand All @@ -52,46 +55,26 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rs/zerolog v1.31.0 // indirect
github.com/snowzach/rotatefilehook v0.0.0-20220211133110-53752135082d // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.8.4 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/swaggo/files/v2 v2.0.0 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/tidwall/gjson v1.17.0 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tidwall/sjson v1.2.5 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/xujiajun/mmap-go v1.0.1 // indirect
github.com/xujiajun/nutsdb v0.11.1 // indirect
github.com/xujiajun/utils v0.0.0-20220904132955-5f7c5b914235 // indirect
go.etcd.io/etcd/api/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
go.etcd.io/etcd/client/v3 v3.5.10 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.7.0 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/grpc v1.59.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
xorm.io/builder v0.3.13 // indirect
)
Loading