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

cherry-pick: Use only local unitxt catalogs when in offline mode (#386) #164

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: 4 additions & 0 deletions controllers/lmes/lmevaljob_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,10 @@ func CreatePod(svcOpts *serviceOptions, job *lmesv1alpha1.LMEvalJob, log logr.Lo
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
}

// Enforce offline mode by default
Expand Down
48 changes: 48 additions & 0 deletions controllers/lmes/lmevaljob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ func Test_SimplePod(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
},
},
Expand Down Expand Up @@ -373,6 +377,10 @@ func Test_WithCustomPod(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
},
{
Expand Down Expand Up @@ -575,6 +583,10 @@ func Test_EnvSecretsPod(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
Command: generateCmd(svcOpts, job),
Args: generateArgs(svcOpts, job, log),
Expand Down Expand Up @@ -741,6 +753,10 @@ func Test_FileSecretsPod(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -1206,6 +1222,10 @@ func Test_ManagedPVC(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},

VolumeMounts: []corev1.VolumeMount{
Expand Down Expand Up @@ -1361,6 +1381,10 @@ func Test_ExistingPVC(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -1533,6 +1557,10 @@ func Test_PVCPreference(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -1736,6 +1764,10 @@ func Test_OfflineMode(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -1940,6 +1972,10 @@ func Test_ProtectedVars(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -2123,6 +2159,10 @@ func Test_OnlineModeDisabled(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -2632,6 +2672,10 @@ func Test_AllowCodeOfflineMode(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down Expand Up @@ -2812,6 +2856,10 @@ func Test_OfflineModeWithOutput(t *testing.T) {
Name: "HF_EVALUATE_OFFLINE",
Value: "1",
},
{
Name: "UNITXT_USE_ONLY_LOCAL_CATALOGS",
Value: "True",
},
},
VolumeMounts: []corev1.VolumeMount{
{
Expand Down
Loading