Skip to content

Commit

Permalink
chore: Cleanup vestigial artifacts (#555)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashok Pon Kumar <[email protected]>
  • Loading branch information
ashokponkumar authored Jul 9, 2021
1 parent 8660f0b commit 9fce1db
Show file tree
Hide file tree
Showing 57 changed files with 48 additions and 345 deletions.
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]. Move2Kube version should return it.
- OS: [e.g. RHEL]
- Version [e.g. 22]. `move2kube version` should return it.

**Additional context**
Add any other context about the problem here.
71 changes: 7 additions & 64 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright IBM Corporation 2020
# Copyright IBM Corporation 2020, 2021
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,11 +13,11 @@
# limitations under the License.

# Builder image
FROM registry.fedoraproject.org/fedora:latest AS build_base
FROM registry.access.redhat.com/ubi8/ubi:latest AS build_base
WORKDIR /temp
RUN dnf install -y git make findutils upx \
&& dnf clean all \
&& rm -rf /var/cache/yum

RUN yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RUN dnf install -y git make upx
ENV GOPATH=/go
RUN mkdir -p $GOPATH/src $GOPATH/bin && chmod -R 777 $GOPATH
ENV PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
Expand All @@ -44,66 +44,9 @@ RUN cp bin/move2kube /bin/move2kube


### Run image ###
FROM registry.fedoraproject.org/fedora:latest
RUN curl -o /usr/local/bin/operator-sdk -LJO 'https://github.com/operator-framework/operator-sdk/releases/download/v1.3.0/operator-sdk_linux_amd64' \
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
RUN curl -o /usr/local/bin/operator-sdk -LJO 'https://github.com/operator-framework/operator-sdk/releases/download/v1.9.0/operator-sdk_linux_amd64' \
&& chmod +x /usr/local/bin/operator-sdk
# Install utils
RUN dnf install -y findutils podman \
&& dnf clean all \
&& rm -rf /var/cache/yum
COPY containerconfig/* /etc/containers/


###################################################
#### Setting up environment for Containerizers ####
###################################################

ENV M2KCONTAINERIZER_ENV_AVAILABLE=true

# Install Java, python and utils
RUN dnf install -y \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel \
unzip \
python38 \
&& dnf clean all \
&& rm -rf /var/cache/yum \
which
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk/

# Downloading and installing Maven
ENV MAVEN_VERSION 3.6.3
ENV BASE_URL https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& echo "Downloading maven" \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& echo "Unziping maven" \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& echo "Cleaning and setting links" \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$HOME/.m2"

# Downloading and installing Gradle
ENV GRADLE_VERSION 4.0.1
ENV GRADLE_HOME /usr/bin/gradle
ENV GRADLE_USER_HOME /cache
ENV PATH $PATH:$GRADLE_HOME/bin
ENV GRADLE_BASE_URL https://services.gradle.org/distributions
RUN mkdir -p /usr/share/gradle /usr/share/gradle/ref \
&& echo "Downloading gradle hash" \
&& curl -fsSL -o /tmp/gradle.zip ${GRADLE_BASE_URL}/gradle-${GRADLE_VERSION}-bin.zip \
&& echo "Unziping gradle" \
&& unzip -d /usr/share/gradle /tmp/gradle.zip \
&& echo "Cleaning and setting links" \
&& rm -f /tmp/gradle.zip \
&& ln -s /usr/share/gradle/gradle-${GRADLE_VERSION} /usr/bin/gradle

####################################################
# Setup Move2Kube
####################################################

COPY --from=build_base /bin/move2kube /bin/move2kube
VOLUME ["/workspace"]
#"/var/run/docker.sock" needs to be mounted for CNB containerization to use docker
Expand Down
39 changes: 13 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[![Build](https://github.com/konveyor/move2kube/workflows/Build/badge.svg "Github Actions")](https://github.com/konveyor/move2kube/actions?query=workflow%3ABuild)
[![Docker Repository on Quay](https://quay.io/repository/konveyor/move2kube/status "Docker Repository on Quay")](https://quay.io/repository/konveyor/move2kube)
[![License](https://img.shields.io/:license-apache-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/konveyor/move2kube/pulls)
[![Go Report Card](https://goreportcard.com/badge/github.com/konveyor/move2kube)](https://goreportcard.com/report/github.com/konveyor/move2kube)
[<img src="https://img.shields.io/badge/slack-konveyor/move2kube-green.svg?logo=slack">](https://kubernetes.slack.com/archives/CR85S82A2)


# Move2Kube

Move2Kube is a command-line tool that accelerates the process of re-platforming to Kubernetes/Openshift. It does so by analysing the environment and source artifacts, and asking guidance from the user when required.
Move2Kube is a command-line tool that accelerates the process of re-platforming to Kubernetes/Openshift. It does so by analysing the environment and source artifacts, and asking guidance from the user when required. It allows customizations to enable generating the directory structure and artifacts in the format required for your project.

![Usage](./imgs/overview.png)

Expand Down Expand Up @@ -39,30 +39,22 @@ brew install move2kube

## UI

We also provide a UI version of Move2Kube
To bring up UI version:

* Change directory to an empty directory using say, `mkdir -p workspace && cd workspace`
* Run `docker run -p 8080:8080 -v $PWD:/workspace -v /var/run/docker.sock:/var/run/docker.sock -it quay.io/konveyor/move2kube-aio:latest`
* Access the UI in `http://localhost:8080/`.

## Usage

### Simple Usage

`move2kube transform -s src` , where src is the folder containing the source artifacts.

### Involved Usage

![Usage](./imgs/usage.png)

Checkout the [Getting started](https://move2kube.konveyor.io/docs/getting-started) guide and [Tutorials](https://move2kube.konveyor.io/docs/tutorial) for more information.

## Prerequisites

* Docker [(MAC](https://docs.docker.com/desktop/)[/Ubuntu](https://docs.docker.com/engine/install/ubuntu/)[/Windows WSL)](https://docs.docker.com/docker-for-windows/wsl/) - If Cloud Native Buildpack (CNB) support is required.

## Development environment setup

To browse code [![Open in VSCode](https://open.vscode.dev/badges/open-in-vscode.svg)](https://open.vscode.dev/konveyor/move2kube)

1. Obtain a recent version of `golang`. Known to work with `1.16`.
1. Ensure `$GOPATH` is set. If it's not set:
1. `mkdir ~/go`
Expand All @@ -78,14 +70,13 @@ Checkout the [Getting started](https://move2kube.konveyor.io/docs/getting-starte

| Source | Artifact available | Features supported |
|:-------|:-------------------|:-------------------|
| Cloud Foundry | Manifest files | Containerization options from buildpacks, Deployment artifacts |
| Cloud Foundry | Manifest files, Source code | Containerization options based on buildpack/source code, Deployment artifacts |
| Cloud Foundry | Manifest files, Source code, Access to running instance | Containerization options based on buildpack/source code, Deployment artifacts, Metadata from runtime |
| Cloud Foundry | Access to running instance | Metadata from runtime, Containerization options based on buildpack, Deployment artifacts |
| Cloud Foundry | Manifest files, Source code | Containerization options based on source code, Deployment artifacts |
| Cloud Foundry | Manifest files, Source code, Access to running instance | Containerization options based on source code, Deployment artifacts, Metadata from runtime |
| Dockerfile | Dockerfile | Deployment artifacts, CI/CD pipeline artifacts |
| Docker Compose/Swarm | Docker compose files | Deployment artifacts |
| Docker Compose/Swarm | Docker compose files, Docker images | Deployment artifacts, Ability to enhance images to run in secure environments like Openshift. |
| Source Directories | Source code with no source metadata | Containerization options based on source code, Deployment artifacts |
| Any source | Access to target cluster | Ability to create artifacts customized for that particular cluster with the most preferred GroupVersion for the kind. |
| Docker Compose/Swarm | Docker compose files, Docker images | Deployment artifacts, CI/CD pipeline artifacts |
| Source Directories | Source code with no source metadata | Containerization options based on source code, Deployment artifacts, CI/CD artifacts |
| Kubernetes Yamls | Kubernetes Yamls | Parameterize and create Helm chart, Kustomize yamls and Openshift templates. |

## Output

Expand All @@ -96,15 +87,11 @@ Checkout the [Getting started](https://move2kube.konveyor.io/docs/getting-starte
* Deployment artifacts
* Kubernetes/Openshift Yamls
* Helm charts
* Kustomize
* Openshift Templates
* Operator
* Docker compose

## Move2Kube Demo
* A short demo of using Move2Kube end-to-end, i.e., starting from the generation of the target deployment artifacts using the source artifacts, to finally deploying the applications on Kubernetes using the generated target artifacts, can be watched in the below link.

![End-to-End demo](./imgs/e2e-flow.svg)

## Discussion

* Check out the [document guides](./docs) to extend Move2Kube.
* For any questions reach out to us on any of the communication channels given on our website https://move2kube.konveyor.io/
File renamed without changes.
6 changes: 3 additions & 3 deletions cmd/move2kube/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"path/filepath"
"strings"

"github.com/konveyor/move2kube/api"
"github.com/konveyor/move2kube/lib"
"github.com/konveyor/move2kube/types"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -61,9 +61,9 @@ func collectHandler(flags collectFlags) {
}
outpath = filepath.Join(filepath.Clean(outpath), types.AppNameShort+"_collect")
if annotations == "" {
api.Collect(srcpath, outpath, []string{})
lib.Collect(srcpath, outpath, []string{})
} else {
api.Collect(srcpath, outpath, strings.Split(annotations, ","))
lib.Collect(srcpath, outpath, strings.Split(annotations, ","))
}
logrus.Infof("Collect Output in [%s]. Copy this directory into the source directory to be used for planning.", outpath)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/move2kube/parameterize.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"os"
"path/filepath"

"github.com/konveyor/move2kube/api"
"github.com/konveyor/move2kube/internal/common"
"github.com/konveyor/move2kube/lib"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down Expand Up @@ -62,7 +62,7 @@ func parameterizeHandler(_ *cobra.Command, flags parameterizeFlags) {
startQA(flags.qaflags)

// Parameterization
filesWritten, err := api.Parameterize(flags.srcpath, flags.customizationsPath, flags.outpath)
filesWritten, err := lib.Parameterize(flags.srcpath, flags.customizationsPath, flags.outpath)
if err != nil {
logrus.Fatalf("Failed to apply all the parameterizations. Error: %q", err)
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/move2kube/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"path/filepath"
"strings"

"github.com/konveyor/move2kube/api"
"github.com/konveyor/move2kube/internal/common"
"github.com/konveyor/move2kube/lib"
"github.com/konveyor/move2kube/qaengine"
plantypes "github.com/konveyor/move2kube/types/plan"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -81,12 +81,12 @@ func planHandler(flags planFlags) {
}
qaengine.StartEngine(true, 0, true)
qaengine.SetupConfigFile("", flags.setconfigs, flags.configs, flags.preSets)
p := api.CreatePlan(srcpath, "", customizationsPath, name)
p := lib.CreatePlan(srcpath, "", customizationsPath, name)
if err = plantypes.WritePlan(planfile, p); err != nil {
logrus.Errorf("Unable to write plan file (%s) : %s", planfile, err)
return
}
api.Destroy()
lib.Destroy()
logrus.Infof("Plan can be found at [%s].", planfile)
}

Expand Down
10 changes: 5 additions & 5 deletions cmd/move2kube/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"os"
"path/filepath"

"github.com/konveyor/move2kube/api"
"github.com/konveyor/move2kube/internal/common"
"github.com/konveyor/move2kube/lib"
"github.com/konveyor/move2kube/types/plan"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -94,7 +94,7 @@ func transformHandler(cmd *cobra.Command, flags transformFlags) {
}
startQA(flags.qaflags)
logrus.Debugf("Creating a new plan.")
p = api.CreatePlan(flags.srcpath, flags.outpath, flags.customizationsPath, flags.name)
p = lib.CreatePlan(flags.srcpath, flags.outpath, flags.customizationsPath, flags.name)
} else {
logrus.Infof("Detected a plan file at path %s. Will transform using this plan.", flags.planfile)
rootDir := ""
Expand Down Expand Up @@ -130,10 +130,10 @@ func transformHandler(cmd *cobra.Command, flags transformFlags) {
}
startQA(flags.qaflags)
}
p = api.CuratePlan(p, flags.outpath)
api.Transform(p, flags.outpath)
p = lib.CuratePlan(p, flags.outpath)
lib.Transform(p, flags.outpath)
logrus.Infof("Transformed target artifacts can be found at [%s].", flags.outpath)
api.Destroy()
lib.Destroy()
}

func getTransformCommand() *cobra.Command {
Expand Down
4 changes: 2 additions & 2 deletions cmd/move2kube/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"path/filepath"

"github.com/konveyor/move2kube/api"
"github.com/konveyor/move2kube/lib"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand All @@ -38,7 +38,7 @@ func validateHandler(flags validateFlags) {
if err != nil {
logrus.Fatalf("Failed to make the directory path %q absolute. Error: %q", artifactspath, err)
}
api.PrintValidate(artifactspath)
lib.PrintValidate(artifactspath)
}

func getValidateCommand() *cobra.Command {
Expand Down
2 changes: 1 addition & 1 deletion cmd/move2kube/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package main
import (
"fmt"

api "github.com/konveyor/move2kube/api"
api "github.com/konveyor/move2kube/lib"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
3 changes: 0 additions & 3 deletions containerconfig/containers.conf

This file was deleted.

Loading

0 comments on commit 9fce1db

Please sign in to comment.