Skip to content
Draft
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
1,217 changes: 782 additions & 435 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
pipeline {

agent {
label joyCommonLabels(image_ver: '21.4.0', pi:'20210826T002459Z')
label joyCommonLabels(image_ver: '24.4.1', pi: '20240111T002438Z')
}

options {
Expand Down
31 changes: 19 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
#

#
# Copyright 2024 MNX Cloud, Inc.
# Copyright 2025 MNX Cloud, Inc.
#

NAME = smartos-ui
RUST_TOOLCHAIN = 1.75.0
RUST_TOOLCHAIN = 1.84.1
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this bump the minimum PI that SmartOS UI needs?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oooh, I see the code to check for that is commented out, and dependent on manta...

        # # Get the minimium supported PI from the Manta object's metadata
        # minimium_pi=$("${CURL[@]}" -I -o /dev/null -w '%header{m-minimum-pi}' \
        #   "${URL_PREFIX}/smartos-ui-$version.tar.gz")

        # if [[ "${Live_Image:?}" < "$minimium_pi" ]]; then
        #       err "$version requires a platform image of $minimium_pi or newer"
        # fi

That starts at line 181 of uiadm.sh.


ENGBLD_USE_BUILDIMAGE = false
ENGBLD_SKIP_VALIDATE_BUILDENV = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we need that with the recent push to eng?

ENGBLD_BITS_UPLOAD_IMGAPI = false

ENGBLD_REQUIRE := $(shell git submodule update --init deps/eng)
Expand All @@ -21,7 +22,7 @@ include ./deps/eng/tools/mk/Makefile.rust.defs

export STAMP

BUILD_PLATFORM = 20210826T002459Z
BUILD_PLATFORM := 20240111T002438Z
Copy link
Contributor

Choose a reason for hiding this comment

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

That happens to be the PI of where the one zone landed. Did you pick that for that specific reason? Or is there another?

RELEASE_TARBALL := $(NAME)-pkg-$(STAMP).tar.gz
RELSTAGEDIR := /tmp/$(NAME)-$(STAMP)

Expand All @@ -35,7 +36,7 @@ JS_FILES ?= $(wildcard $(TOP)/ui/assets/*.js)
.PHONY: nodejs
ifeq ($(shell uname -s),SunOS)
nodejs:
pkgin -y in npm
pkgin -y in "nodejs>14"
else
# On other OSes, assume you have a new enough Node
nodejs:
Expand All @@ -51,13 +52,11 @@ ui/assets/node_modules: ui/assets/package.json ui/assets/package-lock.json
# be replaced with sdc-node.)
git checkout ui/assets/package-lock.json

ui/assets/main.css: ui/assets/main.in.css ui/assets/tailwind.config.js $(J2_FILES)
ui/assets/main.css: ui/assets/main.in.css ui/assets/tailwind.config.js ui/assets/node_modules $(J2_FILES)
cd ui/assets && \
./node_modules/.bin/tailwindcss -m -i ./main.in.css -o ./main.css && \
gsed -i -e 's/\/\*\#\ sourceMappingURL=main.css.map\ \*\///' ./main.css
./node_modules/.bin/tailwindcss -m -i ./main.in.css -o ./main.css

ui/assets/main.css.gz: ui/assets/node_modules ui/assets/main.css
cd ui/assets && rm -f ./main.css.gz && gzip ./main.css
ui/assets/main.css.map: ui/assets/main.css

ui/assets/main.js: ui/assets/node_modules $(JS_FILES)
cd ui/assets && \
Expand All @@ -66,11 +65,11 @@ ui/assets/main.js: ui/assets/node_modules $(JS_FILES)
--format=esm \
--outfile=main.js

ui/assets/main.js.gz: ui/assets/main.js
cd ui/assets && rm -f main.js.gz && gzip ./main.js
%.gz: %
gzip <$< > $@

.PHONY: assets
assets: nodejs ui/assets/main.css.gz ui/assets/main.js.gz
assets: nodejs ui/assets/main.css.gz ui/assets/main.css.map.gz ui/assets/main.js.gz

.PHONY: clean
clean:: clean-assets
Expand Down Expand Up @@ -181,6 +180,8 @@ release: all

.PHONY: publish
publish: release
# The eng tooling that will ship these depends on md5sum from coreutils
pkgin -y in coreutils
mkdir -p $(ENGBLD_BITS_DIR)/$(NAME)
cp -p $(TOP)/$(NAME)-$(STAMP).tar.gz \
$(ENGBLD_BITS_DIR)/$(NAME)
Expand All @@ -190,3 +191,9 @@ include ./deps/eng/tools/mk/Makefile.deps
include ./deps/eng/tools/mk/Makefile.targ
include ./deps/eng/tools/mk/Makefile.rust.targ

.PHONY: world
world: $(TOP)/tools/uiadm.sh

.PHONY: install
install: $(TOP)/tools/uiadm.sh
cp -p $< $(DESTDIR)/sbin/uiadm
2 changes: 1 addition & 1 deletion deps/eng
4 changes: 2 additions & 2 deletions executor/src/endpoints/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/*
* Copyright 2024 MNX Cloud, Inc.
* Copyright 2025 MNX Cloud, Inc.
*/

use std::process::Stdio;
Expand Down Expand Up @@ -186,7 +186,7 @@ pub async fn post_import_by_id(
return Err(to_internal_error("Unable to get image import queue"));
}

let args = ["import", "-q", "-S", &req.url.as_ref(), &id.to_string()];
let args = ["import", "-q", "-S", req.url.as_ref(), &id.to_string()];
debug!(ctx.log, "Executing imgadm {:?}", &args);
let out = Command::new("imgadm")
.args(args)
Expand Down
4 changes: 2 additions & 2 deletions shared/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,13 @@ impl Image {
/// Helper for determining if we should offer the option of setting a
/// root_pw for an image
pub fn has_root_user(&self) -> bool {
return match &self.manifest.r#type {
match &self.manifest.r#type {
Type::ZVol => match &self.manifest.users {
Some(users) => users.iter().any(|user| user.name == "root"),
None => true,
},
_ => false,
};
}
}

/// Helper for determining if we should set the bootrom to uefi
Expand Down
5 changes: 5 additions & 0 deletions ui/assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
"scripts": {
"fmt": "standard --fix *.js ../../test/mock/imgadm ../../test/mock/vmadm ../../test/mock/vminfod"
},
"standard": {
"ignore": [
"main.js"
]
},
"dependencies": {
"@tailwindcss/forms": "^0.5.7",
"bunyan": "^1.8.15",
Expand Down
18 changes: 17 additions & 1 deletion ui/src/endpoints/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/*
* Copyright 2024 MNX Cloud, Inc.
* Copyright 2025 MNX Cloud, Inc.
*/

use crate::endpoints::Context;
Expand Down Expand Up @@ -58,3 +58,19 @@ pub async fn get_css_main(
.body(Body::from(bytes))
.map_err(to_internal_error)
}

#[endpoint {
method = GET,
path = "/css/main.css.map"
}]
pub async fn get_css_main_map(
_: RequestContext<Context>,
) -> Result<Response<Body>, HttpError> {
let bytes =
Bytes::from_static(include_bytes!("../../assets/main.css.map.gz"));
Response::builder()
.header("Content-Encoding", "gzip")
.header("Content-Type", "text/css")
.body(Body::from(bytes))
.map_err(to_internal_error)
}
5 changes: 4 additions & 1 deletion ui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/*
* Copyright 2024 MNX Cloud, Inc.
* Copyright 2025 MNX Cloud, Inc.
*/

#[macro_use]
Expand Down Expand Up @@ -123,6 +123,9 @@ async fn main() -> Result<(), String> {
// /css/main.css
api.register(endpoints::assets::get_css_main)?;

// /css/main.css.map
api.register(endpoints::assets::get_css_main_map)?;

// /instances
api.register(endpoints::instances::get_index)?;
api.register(endpoints::instances::get_by_id)?;
Expand Down