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

WIP: Add intel vsp #210

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 24 additions & 0 deletions Dockerfile.IntelVSP.rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#/usr/local/lib/python3.9/site-packages/ SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2024 Intel Corporation
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.22-openshift-4.18 AS builder
ARG TARGETOS
ARG TARGETARCH

COPY . /usr/src/ipu-opi-plugin
WORKDIR /usr/src/ipu-opi-plugin
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -o bin/ipuplugin cmd/intelvsp/intelvsp.go

FROM registry.ci.openshift.org/ocp/4.18:base-rhel9

COPY --from=builder /usr/src/ipu-opi-plugin/bin/ipuplugin /usr/bin/
COPY cmd/intelvsp/fxp-net_linux-networking.pkg /
Copy link
Contributor

@sudhar-krishnakumar sudhar-krishnakumar Nov 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't have that as variables at this level, hence I've replaced the vars with what we are using.

Also, since there is code that reads the env var (which we should remove, and use a proper function to set it), I've added it to the call-site.

RUN mkdir -p /opt/p4/p4-cp-nws/bin/
COPY cmd/intelvsp/p4rt-ctl /opt/p4/p4-cp-nws/bin/
#TODO: Update to newer package, according to release.
COPY cmd/intelvsp/p4runtime-2023.11.0-py3-none-any.whl /opt/p4/p4-cp-nws/bin/
RUN dnf install -y python3-pip openssh NetworkManager openvswitch iproute
RUN python3 -m pip install --no-cache-dir /opt/p4/p4-cp-nws/bin/p4runtime-2023.11.0-py3-none-any.whl

WORKDIR /
LABEL io.k8s.display-name="IPU OPI Plugin"
ENV PYTHONUNBUFFERED=1
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ REGISTRY ?= $(shell hostname)
DPU_OPERATOR_IMAGE := $(REGISTRY):5000/dpu-operator:dev
DPU_DAEMON_IMAGE := $(REGISTRY):5000/dpu-daemon:dev
MARVELL_VSP_IMAGE := $(REGISTRY):5000/mrvl-vsp:dev
INTEL_VSP_IMAGE := $(REGISTRY):5000/intel-vsp:dev

.PHONY: local-deploy-prep
prep-local-deploy: tools
Expand All @@ -245,6 +246,7 @@ local-build: ## Build all container images necessary to run the whole operator
$(CONTAINER_TOOL) build -v $(GO_CONTAINER_CACHE):/go:z -f Dockerfile.rhel -t $(DPU_OPERATOR_IMAGE)
$(CONTAINER_TOOL) build -v $(GO_CONTAINER_CACHE):/go:z -f Dockerfile.daemon.rhel -t $(DPU_DAEMON_IMAGE)
$(CONTAINER_TOOL) build -v $(GO_CONTAINER_CACHE):/go:z -f Dockerfile.mrvlVSP.rhel -t $(MARVELL_VSP_IMAGE)
$(CONTAINER_TOOL) build -v $(GO_CONTAINER_CACHE):/go:z -f Dockerfile.IntelVSP.rhel -t $(INTEL_VSP_IMAGE)

.PHONY: local-buildx
local-buildx: ## Build all container images necessary to run the whole operator
Expand All @@ -258,18 +260,23 @@ local-buildx: ## Build all container images necessary to run the whole operator
buildah manifest rm $(MARVELL_VSP_IMAGE)-manifest || true
buildah manifest create $(MARVELL_VSP_IMAGE)-manifest
buildah build --authfile /root/config.json --manifest $(MARVELL_VSP_IMAGE)-manifest --platform linux/amd64,linux/arm64 -v $(GO_CONTAINER_CACHE):/go:z -f Dockerfile.mrvlVSP.rhel -t $(MARVELL_VSP_IMAGE)
buildah manifest rm $(INTEL_VSP_IMAGE)-manifest || true
buildah manifest create $(INTEL_VSP_IMAGE)-manifest
buildah build --authfile /root/config.json --manifest $(INTEL_VSP_IMAGE)-manifest --platform linux/amd64,linux/arm64 -v $(GO_CONTAINER_CACHE):/go:z -f Dockerfile.IntelVSP.rhel -t $(INTEL_VSP_IMAGE)

.PHONY: local-pushx
local-pushx: ## Push all container images necessary to run the whole operator
buildah manifest push --all $(DPU_OPERATOR_IMAGE)-manifest docker://$(DPU_OPERATOR_IMAGE)
buildah manifest push --all $(DPU_DAEMON_IMAGE)-manifest docker://$(DPU_DAEMON_IMAGE)
buildah manifest push --all $(MARVELL_VSP_IMAGE)-manifest docker://$(MARVELL_VSP_IMAGE)
buildah manifest push --all $(INTEL_VSP_IMAGE)-manifest docker://$(INTEL_VSP_IMAGE)

.PHONY: local-push
local-push: ## Push all container images necessary to run the whole operator
$(CONTAINER_TOOL) push $(DPU_OPERATOR_IMAGE)
$(CONTAINER_TOOL) push $(DPU_DAEMON_IMAGE)
$(CONTAINER_TOOL) push $(MARVELL_VSP_IMAGE)
$(CONTAINER_TOOL) push $(INTEL_VSP_IMAGE)
# PLATFORMS defines the target platforms for the manager image be build to provide support to multiple
# architectures. (i.e. make docker-buildx IMG=myregistry/mypoperator:0.0.1). To use this option you need to:
# - able to use docker buildx . More info: https://docs.docker.com/build/buildx/
Expand Down
Binary file added cmd/intelvsp/fxp-net_linux-networking.pkg
Binary file not shown.
9 changes: 9 additions & 0 deletions cmd/intelvsp/intelvsp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package intelvsp

import (
"github.com/intel/ipu-opi-plugins/ipu-plugin/ipuplugin/cmd"
)

func main() {
cmd.Execute()
}
Loading